Error occurred while refreshing the cache for directory

JRA-38289 - Getting issue details... STATUS
Version observed 6.0.5
Affects Embedded Crowd, LDAP Directory
Bug Report


JRA-38289

Getting issue details…
STATUS

Symptoms

  • LDAP directory synchronisation fails
  • The following appears in the atlassian-jira.log:
2014-03-05 06:30:15,246 QuartzScheduler_Worker-1 INFO      [atlassian.crowd.directory.DbCachingRemoteDirectory] failed synchronisation complete for directory [ 10000 ] in [ 12ms ]
2014-03-05 06:30:15,667 QuartzScheduler_Worker-1 ERROR      [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10000 ].
java.lang.IllegalArgumentException: Passed List had more than one value.
	at org.ofbiz.core.entity.EntityUtil.getOnly(EntityUtil.java:62)
	at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.isDirectMember(OfBizInternalMembershipDao.java:85)
	at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.isGroupDirectMember(OfBizInternalMembershipDao.java:80)
	at com.atlassian.jira.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.isGroupDirectMember(OfBizDelegatingMembershipDao.java:70)
	at com.atlassian.crowd.directory.AbstractInternalDirectory.isGroupDirectGroupMember(AbstractInternalDirectory.java:711)
	at com.atlassian.crowd.directory.AbstractInternalDirectory.removeGroupFromGroup(AbstractInternalDirectory.java:768)
	at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.removeGroupMembershipsForGroup(DbCachingRemoteChangeOperations.java:879)
	at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncGroupMembersForGroup(DirectoryCacheImplUsingChangeOperations.java:145)
	at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:149)
	at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:84)
	at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAll(UsnChangedCacheRefresher.java:124)
	at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:644)
	at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63)
	at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)
	at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJob.execute(DirectoryPollerJob.java:34)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:195)

Cause

User has duplicate membership for a group in the same directory

The most common reason is that the information in the database is inconsistent resulting in one or more users having duplicate membership information for the same group within the same directory. In that case, the logs show the exception «Passed List had more than one value» for the method «com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.isDirectMember».

java.lang.IllegalArgumentException: Passed List had more than one value.
	at org.ofbiz.core.entity.EntityUtil.getOnly(EntityUtil.java:62)
	at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.isDirectMember(OfBizInternalMembershipDao.java:85)
...

Resolution

The recommended way to resolve the problem is to disable the affected LDAP directory and enable it again. This will re-create the user to group mappings for the affected directory.

Workaround

This workaround is advised only if you do not wish to disable and re-enable the LDAP Directory from the JIRA administration interface. This could be because you have LDAP users mapped to local (JIRA internal) groups, which are removed when you disable the LDAP directory.

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

  1. Identify the duplicate database entries by executing the following SQL command:

    PostgreSQL database:

    SELECT 
      directory_id || ', ' || lower_parent_name || ', ' || child_name AS "directory_id, lower_parent_name, child_name",
      COUNT(id) 
    FROM 
      cwd_membership 
    GROUP BY 
      directory_id || ', ' || lower_parent_name || ', ' || child_name 
    HAVING 
      COUNT(ID) > 1;
    

    Microsoft SQL Server:

    SELECT 
      cast(directory_id as varchar) + ', ' 
      + lower_parent_name + ', ' 
      + child_name 
        AS "directory_id, lower_parent_name, child_name"
      , COUNT(id) 
    FROM 
      jiraschema.cwd_membership 
    GROUP BY 
      cast(directory_id as varchar) + ', ' + lower_parent_name + ', ' + child_name 
    HAVING COUNT(ID) > 1;

    Please replace «jiraschema» with the correct schema from your database.

  2. For each of the returned mappings, identify the duplicate rows using the following query, substituting values of <DIRECTORY_ID>, <LOWER_PARENT_NAME> and <CHILD_NAME> with the result from previous query:

    SELECT 
      id, directory_id, lower_parent_name, child_name
    FROM cwd_membership
    WHERE 
      directory_id = <DIRECTORY_ID> AND lower_parent_name = '<LOWER_PARENT_NAME>' AND child_name = '<CHILD_NAME>';

    and delete one of the duplicate rows from the database using the following query, substituting the value of <ID> from the above query:

    DELETE FROM cwd_membership WHERE id = <ID>;
  3. Start a synchronisation for the LDAP directory from the JIRA interface.

   

Summary

LDAP directory fails to synchronize.

Environment

Jira 8.x.x

Diagnosis

  • The following error appears in atlassian-jira.log:
2022-03-20 11:24:55,451+0200 Caesium-1-3 ERROR ServiceRunner     [c.a.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10200 ].
com.querydsl.core.QueryException: Caught SQLException for insert into cwd_synchronisation_status (directory_id, sync_start, sync_status, status_parameters, id)
values (?, ?, ?, ?, ?)
...
Caused by: java.sql.SQLException: Field 'status' doesn't have a default value
...
  • Checking the definition of the table cwd_synchronisation_status, we see there are extra columns that should not be present (including the «status» column which makes the synchronization to fail):
  `node_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `status` varchar(32) COLLATE utf8_bin NOT NULL,
  `incremental_sync_error` mediumtext COLLATE utf8_bin,
  `full_sync_error` mediumtext COLLATE utf8_bin,

Example of query which can be used in PostgreSQL: 

select column_name from information_schema.columns where table_name = 'cwd_synchronisation_status';

Cause

The table cwd_synchronisation_status includes extra columns such as «status» which normally should not exist in a Jira instance.

The exact reasons are unknown, but one cause could be that another application was using at some point the same database (eg. Confluence).

Solution

Please take a full backup of your Jira database prior to proceeding with the following steps.

Please test the steps on a lower environment prior to performing them on your Production instance.

  • Make sure no other application is using Jira’s database.
  • Stop Jira.
  • Access the Jira database and DROP the «cwd_synchronisation_status» table. 
  • Confirm that the table is successfully dropped.
  • Start Jira.
  • Check the structure of the «cwd_synchronisation_status» table and make sure there is no «status» column.
  • Perform a synchronisation of the Active Directory.

Last modified on Aug 29, 2022

Related content

  • No related content found

After the upgrading of Crowd, our servers experimented a new problem… sometimes Crowd becomes “stuck” (also JIRA & Confluence because the SSO) and the log of Crowd show errors in the LDAP connection… but not always… two times a week.. etc.

Examples of errors in the log:

Caused by: com.atlassian.crowd.exception.OperationFailedException: org.springframework.ldap.PartialResultException: nested exception is javax.naming.PartialResultException [Root exception is javax.naming.CommunicationException: xxxx.com:xxx [Root exception is java.net.ConnectException: Connection refused]]
at com.atlassian.crowd.directory.SpringLDAPConnector.pageSearchResults(SpringLDAPConnector.java:441)

ERROR [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ xxxx].
com.atlassian.crowd.model.group.Membership$MembershipIterationException: com.atlassian.crowd.exception.OperationFailedException: org.springframework.ldap.PartialResultException: nested exception is javax.naming.PartialResultException [Root exception is javax.naming.CommunicationException: xxxx:xx [Root exception is java.net.ConnectException: Connection refused]]

Caused by: org.springframework.ldap.PartialResultException: nested exception is javax.naming.PartialResultException [Root exception is javax.naming.CommunicationException: xxx:xx [Root exception is java.net.ConnectException: Connection refused]]
at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:216)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:385)

….

Caused by: javax.naming.PartialResultException [Root exception is javax.naming.CommunicationException: xxxx:xx [Root exception is java.net.ConnectException: Connection refused]]
at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreImpl(AbstractLdapNamingEnumeration.java:237)

SQL Error: 1062, SQLState: 23000

ERROR [engine.jdbc.spi.SqlExceptionHelper] Duplicate entry ’06T1QBOOMdAa0dQxxxxXXX’ for key ‘uk_token_id_hash’

Where is the problem? Why it happens only two times a week?….

After talk with the Atlassian support team, we got the SOLUTION…

DISABLE THE REFERRALS IN LDAP and GROW UP THE LDAP TIMEOUTS…

Very easy… example of Database queries to solve the problem:

update crowddb.cwd_directory_attribute SET attribute_value= ‘false’ where attribute_name=’ldap.referral’;
update crowddb.cwd_directory_attribute SET attribute_value= ‘240000’ where attribute_name=’ldap.read.timeout’;
update crowddb.cwd_directory_attribute SET attribute_value= ‘120000’ where attribute_name=’ldap.connection.timeout’;

The explanation is the current Active Directory configuration and how it resolved the DNS… but it is solved with this trick! Easy and effective! IMPORTANT: The trick is not recommended to Active Directories with multiple domains

Many thanks Atlassian support team!

  • Remove From My Forums
  • Вопрос

  • I see get many errors at application event log after the «In place upgrade»:

    Serverfarm: 1 Application Server, 2 Frontend Server, 1 Report Server, 1 SQL Server (All 2008 R2 64bit)

    ####################
    An unexpected error occurred while refreshing the shared object manager cache.

    Reason: Security error.

    Techinal Details:
    System.Security.SecurityException: Security error.
       at Microsoft.SharePoint.Administration.SPAutoSerializingObject.GetInstanceFromType(Type type)
       at Microsoft.SharePoint.Administration.SPPersistedObject.GetInstance(XmlNode xml, Guid classId)
       at Microsoft.SharePoint.Administration.SPFileSystemCache.FetchObjectFromFileSystem(Guid id)
       at Microsoft.SharePoint.Administration.SPFileSystemCache.GetValue(Guid id)
       at Microsoft.SharePoint.Administration.SPCache`2.get_Item(K key)
       at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id, Boolean checkInMemoryCache)
       at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id)
       at Microsoft.SharePoint.Administration.SPFarm.GetObject(Guid id)
       at Microsoft.Office.Server.Administration.SharedResourceProviderStoreDependency.get_IsValid()
       at Microsoft.Office.Server.Administration.SharedObjectManager.Refresh()
    The Zone of the assembly that failed was:
    MyComputer
    ###############################

    At Central Administration for example I want see «Servers in Farm» I get this error:

    ################################

    Error

    Could not load type ‘Microsoft.Office.Server.Administration.SharedWebServiceInstance’ from assembly ‘Microsoft.Office.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’.

    Troubleshoot issues with Microsoft SharePoint Foundation.

    Correlation ID: 2c80ad36-27c4-4df4-b5c4-8d4b11c233a0

    Date and Time: 5/3/2010 8:29:28 AM

    ########################################

    Where is my error? How can I sove this?


    Ralf Happe Especialista en soluciónes Christobal Colón N° 1 ES 07670 Portocolom Tel.: +34 6961 0375 7 @: service@ralfhappe.com Skype: ralfhappe msm: ralfhappe@hotmail.com www.ralfhappe.com ralfhappe | soluciónes

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

User avatar

JerryF

Level 15
Level 15
Posts: 5944
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

[SOLVED] Desklets Refreshing the Cache error

I wanted to try out a few Desklets in 18.3 Cinnamon and when I click on the Download tab, I get this:

Shutter-004.jpg

then, when I click Yes, I get this:

Shutter-005.jpg

This has been happening for several days now. Any ideas?

Thanks!

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.

Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

tomcashen

Re: Desklets Refreshing the Cache error

Post

by tomcashen » Thu Dec 14, 2017 2:14 pm

Same here. Ever since I installed Mint 18.3 with Cinnamon. I’m assuming it’ll be fixed soon, but thanks for posting with screen shots and all, because this was the question I joined the forums for! :)

waz

Re: Desklets Refreshing the Cache error

Post

by waz » Thu Dec 14, 2017 3:06 pm

This exact same issue is happening to me. I’ve been wrestling with it for a couple hours trying to find a solution online. I cannot install anything even from the partial list is pulls down. I only have access to 3 widgets.

Cosmo.

Level 24
Level 24
Posts: 22043
Joined: Sat Dec 06, 2014 7:34 am

Re: Desklets Refreshing the Cache error

Post

by Cosmo. » Thu Dec 14, 2017 4:43 pm

Can you reach the page in the browser?

If the problem is only in the desklet dialogue, delete the folder .cinnamon/spices.cache/desklet. Note, that the first part of the path is a hidden folder; you have to press ctrl-h to make it visible. The desklet dialogue should be closed during the operation.

User avatar

JerryF

Level 15
Level 15
Posts: 5944
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Desklets Refreshing the Cache error

Post

by JerryF » Thu Dec 14, 2017 5:25 pm

Thanks for your response. Unfortunately, the suggestions from that link didn’t help.

I did a search of .config files from the root directory and got over 300 results. Not sure which I’m supposed to check.

User avatar

JerryF

Level 15
Level 15
Posts: 5944
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Desklets Refreshing the Cache error

Post

by JerryF » Thu Dec 14, 2017 6:49 pm

Cosmo. wrote:Can you reach the page in the browser?

If the problem is only in the desklet dialogue, delete the folder .cinnamon/spices.cache/desklet. Note, that the first part of the path is a hidden folder; you have to press ctrl-h to make it visible. The desklet dialogue should be closed during the operation.

Hi Cosmo,

Thanks so much. Yes, I can reach that url in my browser.

I deleted the folder .cinnamon/spices.cache/desklet while the Desklets dialogue was closed.

I updated the cache and it stops at 18/28 downloaded images.

Shutter-006.jpg

User avatar

Flemur

Level 20
Level 20
Posts: 10103
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Desklets Refreshing the Cache error

Post

by Flemur » Thu Dec 14, 2017 8:51 pm

JerryF wrote:I did a search of .config files from the root directory and got over 300 results.

I deleted the folder .cinnamon/spices.cache/desklet while the Desklets dialogue was closed.

That probably would’ve contained the .config (tho perhaps under a different name — .xml, etc) file I was talking about.

Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up….right?

Cosmo.

Level 24
Level 24
Posts: 22043
Joined: Sat Dec 06, 2014 7:34 am

Re: Desklets Refreshing the Cache error

Post

by Cosmo. » Fri Dec 15, 2017 6:56 am

Do you have the same problem with applets (which have a far greater number of items available)?

Also: Create a fresh new test account and do inside nothing except loading the desklet info. How does this work?

User avatar

JerryF

Level 15
Level 15
Posts: 5944
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Desklets Refreshing the Cache error

Post

by JerryF » Fri Dec 15, 2017 4:56 pm

Cosmo. wrote:Do you have the same problem with applets (which have a far greater number of items available)?

Unfortunately, yes.

Shutter-007.jpg

Also: Create a fresh new test account and do inside nothing except loading the desklet info. How does this work?

I created an account called «testaccount», type=Administrator. I get the same result for updating desklets as my account: HTTP Error 400: Bad Request. But, I can update applets without an error.

User avatar

JerryF

Level 15
Level 15
Posts: 5944
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Desklets Refreshing the Cache error

Post

by JerryF » Fri Dec 15, 2017 7:22 pm

Hi Cosmo,

Using a Live USB, got the same results as the testaccount:

Desklets HTTP Error 400: Bad Request.
Applets update without an error.

Thank you.

Cosmo.

Level 24
Level 24
Posts: 22043
Joined: Sat Dec 06, 2014 7:34 am

Re: Desklets Refreshing the Cache error

Post

by Cosmo. » Sat Dec 16, 2017 6:52 am

Obviously the problem is not in your Mint, but in your Internet connection.

Try to restart the router. Disconnect it from the power line, wait a minute or 2, plug the power cord in again and wait, until the router has completely booted.

User avatar

JerryF

Level 15
Level 15
Posts: 5944
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Desklets Refreshing the Cache error

Post

by JerryF » Sat Dec 16, 2017 6:27 pm

Cosmo. wrote:Sorry, I’m running out of ideas.
Any chance to take the computer to a friend, at best somebody who uses a different ISP?

Yes, it’s a laptop and I can take it to work.

Thanks so much Cosmo. I’ll let you know the results.

User avatar

JerryF

Level 15
Level 15
Posts: 5944
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Desklets Refreshing the Cache error

Post

by JerryF » Sun Dec 17, 2017 10:04 am

Cosmo. wrote:Fine. Don’t forget to take also the live dvd / stick with you, so that you can test there as well the installed systems as the live system.

Thanks again. I always carry my USB Mint with me wherever I go. It’s better than a four-leaf clover. :wink:

  • Remove From My Forums
  • Question

  • Hi All,

    We have recently moved our sharepoint 2003 databases to a new database server.  All appears to work fine, but we now get the following error message at regular intervals in the windows event viewer «An error occurred while refreshing the portal application cache»

    Any ideas?

    Thanks

    David

Answers

  • Hello David,

    This issue is a little complex and maybe we need some steps to narrow down the problem’s scope:

    1.   Confirm that the SPS 2003 has been fully updated, especially SharePoint Portal Server 2003 Service Pack 2:http://www.microsoft.com/downloads/details.aspx?FamilyID=171dc9a7-b4ba-4759-bd64-6b7d851a97ef&displaylang=en  

    2.   Ensure proxy settings are set in the web.config as the following code:

    Code Snippet

         <system.net>

    <defaultProxy>

    <proxy proxyaddress=»http://<server name>» bypassonlocal=»true» />

    <bypasslist>

    <add address=»<IP/NetBIOS/FQDN>» />

    </bypasslist>

    </defaultProxy>

    </system.net>

    3.    Some similar issues are caused by anti-virus applications installed in your system. Please temporarily disable them and test the issue again.

    4.    If the issue persists, please let me know if you’ve ever customized public.aspx file under Program FilesCommon FilesMicrosoft Sharedweb server.

    Let us know the result if possible.

    Regards,

    Lionel

    • Marked as answer by

      Tuesday, July 29, 2008 2:08 AM

Понравилась статья? Поделить с друзьями:
  • Error occurred during login please check server firebird log for details
  • Error occurred during localdb instance startup sql server process failed to start
  • Error occurred during loading data trying to use cache server
  • Error occurred during load
  • Error occurred during initialization of vmcould not reserve enough space for 2097152kb object heap