com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [393219] with name [Bobo.Chu]

Atlassian JIRA | michael fong | 3 years ago
  1. 0

    Has the authenticator been tested with 2.8?

    GitHub | 2 years ago | erkkiaalto
    com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [491521] with name [aalto@helsinki.fi]
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Hi, We are trying to migrate from JIRA 5.1.3 to JIRA 6.1. We have some trouble with LDAP synchronisation. JIRA is trying to update userName and throw the following exception : {code} 2013-09-02 10:46:23,853 QuartzScheduler_Worker-0 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 3 ]. com.atlassian.crowd.exception.OperationFailedException: Unable to rename user 'ut1gbh' to 'UT1GBH', please perform full synchronization. at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.updateUsers(DbCachingRemoteChangeOperations.java:232) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addOrUpdateCachedUsers(DirectoryCacheImplUsingChangeOperations.java:59) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseUserChanges(UsnChangedCacheRefresher.java:220) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseChanges(UsnChangedCacheRefresher.java:81) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:667) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:75) 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) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) Caused by: com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [3] with name [UT1GBH] at com.atlassian.crowd.directory.AbstractInternalDirectory.renameUser(AbstractInternalDirectory.java:559) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.updateUsers(DbCachingRemoteChangeOperations.java:226) ... 9 more {code} I've checked into source code. For the version 5.1.3, you are using the version 2.4.3 of crowd-core module. In class com.atlassian.crowd.directory.DbCachingRemoteChangeOperations, we found ((line 997) ) : {code} if (!remoteUser.getName().equals(internalUser.getName())) { logger.warn("remote username [ {} ] casing differs from local username [ {} ]. User details will be kept updated, but the username cannot be updated", remoteUser.getName(), internalUser.getName()); } if (hasChanged(remoteUser, internalUser)) { final UserTemplate userToUpdate = makeUserTemplate(remoteUser); // Ensure that the username will not be updated userToUpdate.setName(internalUser.getName()); // Ignore active flag value from remote directory and manage it locally if the remote directory does not support active flag. if (!remoteDirectory.supportsInactiveAccounts()) userToUpdate.setActive(internalUser.isActive()); usersToUpdate.add(userToUpdate); } else { logger.trace("user [ {} ] unmodified, skipping", remoteUser.getName()); } {code} For JIRA 6.1-beta1, you are using version 2.7.0-m15 of crowd-core. In same class, we found following code (line 221) : {code} final User currentUser = internalDirectory.findUserByExternalId(externalId); try { if (!StringUtils.equals(currentUser.getName(), user.getName())) { internalDirectory.renameUser(currentUser.getName(), user.getName()); } } catch (UserAlreadyExistsException e) { // Make sure that one bogus user coming over the wire doesn't hose the entire sync. throw new OperationFailedException("Unable to rename user '" + currentUser.getName() + "' to '" + user.getName() + "', please perform full synchronization.", e); {code} In older version you are checking than username will not be updated, but this check was drop on new version. Doing a full synchronisation doesn't correct the problem.

    Atlassian JIRA | 3 years ago | Frédéric Cilia
    com.atlassian.crowd.exception.OperationFailedException: Unable to rename user 'ut1gbh' to 'UT1GBH', please perform full synchronization.
  4. 0

    Hi, We are trying to migrate from JIRA 5.1.3 to JIRA 6.1. We have some trouble with LDAP synchronisation. JIRA is trying to update userName and throw the following exception : {code} 2013-09-02 10:46:23,853 QuartzScheduler_Worker-0 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 3 ]. com.atlassian.crowd.exception.OperationFailedException: Unable to rename user 'ut1gbh' to 'UT1GBH', please perform full synchronization. at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.updateUsers(DbCachingRemoteChangeOperations.java:232) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addOrUpdateCachedUsers(DirectoryCacheImplUsingChangeOperations.java:59) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseUserChanges(UsnChangedCacheRefresher.java:220) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseChanges(UsnChangedCacheRefresher.java:81) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:667) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:75) 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) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) Caused by: com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [3] with name [UT1GBH] at com.atlassian.crowd.directory.AbstractInternalDirectory.renameUser(AbstractInternalDirectory.java:559) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.updateUsers(DbCachingRemoteChangeOperations.java:226) ... 9 more {code} I've checked into source code. For the version 5.1.3, you are using the version 2.4.3 of crowd-core module. In class com.atlassian.crowd.directory.DbCachingRemoteChangeOperations, we found ((line 997) ) : {code} if (!remoteUser.getName().equals(internalUser.getName())) { logger.warn("remote username [ {} ] casing differs from local username [ {} ]. User details will be kept updated, but the username cannot be updated", remoteUser.getName(), internalUser.getName()); } if (hasChanged(remoteUser, internalUser)) { final UserTemplate userToUpdate = makeUserTemplate(remoteUser); // Ensure that the username will not be updated userToUpdate.setName(internalUser.getName()); // Ignore active flag value from remote directory and manage it locally if the remote directory does not support active flag. if (!remoteDirectory.supportsInactiveAccounts()) userToUpdate.setActive(internalUser.isActive()); usersToUpdate.add(userToUpdate); } else { logger.trace("user [ {} ] unmodified, skipping", remoteUser.getName()); } {code} For JIRA 6.1-beta1, you are using version 2.7.0-m15 of crowd-core. In same class, we found following code (line 221) : {code} final User currentUser = internalDirectory.findUserByExternalId(externalId); try { if (!StringUtils.equals(currentUser.getName(), user.getName())) { internalDirectory.renameUser(currentUser.getName(), user.getName()); } } catch (UserAlreadyExistsException e) { // Make sure that one bogus user coming over the wire doesn't hose the entire sync. throw new OperationFailedException("Unable to rename user '" + currentUser.getName() + "' to '" + user.getName() + "', please perform full synchronization.", e); {code} In older version you are checking than username will not be updated, but this check was drop on new version. Doing a full synchronisation doesn't correct the problem.

    Atlassian JIRA | 3 years ago | Frédéric Cilia
    com.atlassian.crowd.exception.OperationFailedException: Unable to rename user 'ut1gbh' to 'UT1GBH', please perform full synchronization.

    Root Cause Analysis

    1. com.atlassian.crowd.exception.UserAlreadyExistsException

      User already exists in directory [393219] with name [Bobo.Chu]

      at com.atlassian.crowd.embedded.hibernate2.HibernateUserDao.rename()
    2. com.atlassian.crowd
      HibernateUserDao.rename
      1. com.atlassian.crowd.embedded.hibernate2.HibernateUserDao.rename(HibernateUserDao.java:95)
      1 frame