Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-40375

User Directory Migration throws error

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Symptom:

      • error thrown in the JIRA UI indicating "'<user>' does not exist"
      • repeating the same step will throws random username does not exist

      Step to reproduce:

      1. install JIRA with internal directory
      2. create a new Internal with Delegated Authentication directory
      3. migrate the users directory from internal to delegated authentication directory
      4. (bug) error thrown in the JIRA UI indicating "'<user>' does not exist"
      5. (bug) in the JIRA logs:
        /plugins/servlet/embedded-crowd/directories/migrate/ [embedded.admin.directory.MigrateDirectoryUsersController] User migration failed
        java.lang.RuntimeException: com.atlassian.crowd.exception.UserNotFoundException: User <johndoe> does not exist
                at com.atlassian.crowd.embedded.admin.directory.MigrateDirectoryUsersController$1.doInTransaction(MigrateDirectoryUsersController.java:146)
                ...
        
        Caused by: com.atlassian.crowd.exception.UserNotFoundException: User <johndoe> does not exist
        at com.atlassian.jira.crowd.embedded.ofbiz.OfBizUserDao.findByName(OfBizUserDao.java:85)
        at com.atlassian.jira.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addUserToGroup(OfBizDelegatingMembershipDao.java:81)
        at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:821)
        at com.atlassian.crowd.directory.DelegatedAuthenticationDirectory.addUserToGroup(DelegatedAuthenticationDirectory.java:805)
        at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.addUserToGroup(DirectoryManagerGeneric.java:757) 
        
      6. (bug) username thrown in the error cannot login into JIRA using the password stored in LDAP

      To verify:

      1. make sure the error is not caused by bug JRA-24889
      2. in the JIRA database check if the user does exist correctly in the app_user, cwd_user, cwd_membership. The SQL queries below can be use:
        select * from app_user where lower_user_name='<sample_username>';
        select * from cwd_user where user_name ='<sample_username>';
        select * from cwd_membership where child_name ='<sample_username>';
        select * from cwd_directory;
        
      3. Important note: restoring the JIRA's data into a test instance and the problem is not reproducible in the test instance.

      Root Cause:
      Broken Cache when creating the user in the new directory.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jalbion Janet Albion (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated: