User directory synchronization fails with NullPointerException at HibernateConfluenceUserDao.rename

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

問題

LDAP/JIRA/Crowd/AD synchronization fails with this error in atlassian-confluence.log:

F2015-12-15 11:20:11,258 ERROR [scheduler_Worker-1] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.user.DirectoryUserRenamedEvent[source=com.atlassian.confluence.user.crowd.CachedCrowdUserDao@17bd4bbb]] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.user.listeners.UserDirectoryListener.onUserRenamedEvent(com.atlassian.confluence.event.events.user.DirectoryUserRenamedEvent), listener=com.atlassian.confluence.user.listeners.UserDirectoryListener@20a2f4c5}]
java.lang.RuntimeException: java.lang.NullPointerException
...
	at com.atlassian.confluence.user.crowd.CachedCrowdUserDao.rename(CachedCrowdUserDao.java:275)
	at sun.reflect.GeneratedMethodAccessor1488.invoke(Unknown Source)
	...
	at com.atlassian.crowd.directory.$Proxy2888.updateUsers(Unknown Source)
	at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addOrUpdateCachedUsers(DirectoryCacheImplUsingChangeOperations.java:62)
	at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAllUsers(UsnChangedCacheRefresher.java:195)
	at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:89)
	at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAll(UsnChangedCacheRefresher.java:168)
	at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1122)
	at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:76)
	at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)
	at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobRunner.runJob(DirectoryPollerJobRunner.java:93)
	at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:135)
...
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.NullPointerException
	at com.atlassian.confluence.user.persistence.dao.hibernate.HibernateConfluenceUserDao.rename(HibernateConfluenceUserDao.java:121)
	at com.atlassian.confluence.impl.user.persistence.dao.CachingConfluenceUserDao.rename(CachingConfluenceUserDao.java:60)
	at sun.reflect.GeneratedMethodAccessor1493.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

原因

Mismatched username and lower_username in the user_mapping table in the Confluence Database

ソリューション

データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

Run this query to identify the mismatch:

SELECT * FROM user_mapping WHERE LOWER(username) != lower_username OR lower_username IS NULL;

Fix the mismatch accordingly, and the issue should be resolved. For some cases, the user record itself will not be there in the user_mapping table for those users which have the rename event. In such cases above query will not provide those records. For fixing those records, first, enable the SQL logging so that we have the actual user records and that can be created manually in the user_mapping table. 

最終更新日 2021 年 7 月 23 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.