Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-2421

'Lower Case Output' option can cause mismatch in database with applications

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.3.2
    • None
    • None

      Situation

      • Crowd and an integrated application are both using a case insensitive databases
      • Data with capital letters has been added to Crowd and the application (users, groups, etc)
      • Lower Case Output is turned on
      • Changes are made to the users and groups
      • There is now inconsistent data between Crowd and the other application

      Exmaple (pictures below):

      • JIRA and Crowd integrated, screenshots show 2 users and 2 groups with upper case and lower case.
      • Turn on Lower Case Output
      • Remove the UPPERCASEGROUP
      • Sync JIRA and notice that there is no change to users/groups
      • Add UPPERCASEGROUP back
      • Sync JIRA, notice the screenshot where it now shows 1 user per group instead of 2.
        • Logs show a duplicate entry error

        1. ci db - lowercase output 1.jpg
          ci db - lowercase output 1.jpg
          197 kB
        2. ci db - lowercase output 2.jpg
          ci db - lowercase output 2.jpg
          171 kB
        3. ci db - lowercase output 3.jpg
          ci db - lowercase output 3.jpg
          164 kB
        4. ci db - lowercase output 4.jpg
          ci db - lowercase output 4.jpg
          166 kB
        5. ci db - lowercase output 5.jpg
          ci db - lowercase output 5.jpg
          212 kB

            [CWD-2421] 'Lower Case Output' option can cause mismatch in database with applications

            It appears that this was fixed by CWD-2148.

            Adrian Hempel [Atlassian] added a comment - It appears that this was fixed by CWD-2148 .

            I've not been able to reproduce this problem with current Crowd code (> 2.5.0) and JIRA 5.1.3.

            Adrian Hempel [Atlassian] added a comment - I've not been able to reproduce this problem with current Crowd code (> 2.5.0) and JIRA 5.1.3.

            David Chan added a comment -

            These are the errors that appear in logs:

            2011-04-20 17:34:50,478 QuartzWorker-1 ERROR ServiceRunner     [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10000 ].
            com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Group][id,10018][groupName,uppercasegroup][updatedDate,2011-04-20 17:34:50.445][description,][directoryId,10000][lowerDescription,][active,1][local,0][type,GROUP][lowerGroupName,uppercasegroup][createdDate,2011-04-20 17:34:50.445] (SQL Exception while executing the following:INSERT INTO cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry 'uppercasegroup-10000' for key 2))
            	at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167)
            	at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:154)
            	at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:140)
            	at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.addAll(OfBizGroupDao.java:134)
            	at com.atlassian.crowd.directory.CachingDirectory.addAllGroups(CachingDirectory.java:101)
            	at com.atlassian.crowd.directory.DbCachingRemoteDirectoryCache.addOrUpdateCachedGroups(DbCachingRemoteDirectoryCache.java:398)
            	at com.atlassian.crowd.directory.ldap.cache.RemoteDirectoryCacheRefresher.synchroniseAllGroups(RemoteDirectoryCacheRefresher.java:84)
            	at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:36)
            	at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:568)
            	at com.atlassian.crowd.manager.directory.DirectorySynchroniserHelperImpl.synchronise(DirectorySynchroniserHelperImpl.java:80)
            	at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:59)
            	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 com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)
            	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
            Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Group][id,10018][groupName,uppercasegroup][updatedDate,2011-04-20 17:34:50.445][description,][directoryId,10000][lowerDescription,][active,1][local,0][type,GROUP][lowerGroupName,uppercasegroup][createdDate,2011-04-20 17:34:50.445] (SQL Exception while executing the following:INSERT INTO cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry 'uppercasegroup-10000' for key 2))
            	at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:156)
            	at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:121)
            	at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63)
            	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:489)
            	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:469)
            	at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77)
            	at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162)
            	... 15 more

            David Chan added a comment - These are the errors that appear in logs: 2011-04-20 17:34:50,478 QuartzWorker-1 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10000 ]. com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Group][id,10018][groupName,uppercasegroup][updatedDate,2011-04-20 17:34:50.445][description,][directoryId,10000][lowerDescription,][active,1][local,0][type,GROUP][lowerGroupName,uppercasegroup][createdDate,2011-04-20 17:34:50.445] (SQL Exception while executing the following:INSERT INTO cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry 'uppercasegroup-10000' for key 2)) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:154) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:140) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.addAll(OfBizGroupDao.java:134) at com.atlassian.crowd.directory.CachingDirectory.addAllGroups(CachingDirectory.java:101) at com.atlassian.crowd.directory.DbCachingRemoteDirectoryCache.addOrUpdateCachedGroups(DbCachingRemoteDirectoryCache.java:398) at com.atlassian.crowd.directory.ldap.cache.RemoteDirectoryCacheRefresher.synchroniseAllGroups(RemoteDirectoryCacheRefresher.java:84) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:36) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:568) at com.atlassian.crowd.manager.directory.DirectorySynchroniserHelperImpl.synchronise(DirectorySynchroniserHelperImpl.java:80) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:59) 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 com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Group][id,10018][groupName,uppercasegroup][updatedDate,2011-04-20 17:34:50.445][description,][directoryId,10000][lowerDescription,][active,1][local,0][type,GROUP][lowerGroupName,uppercasegroup][createdDate,2011-04-20 17:34:50.445] (SQL Exception while executing the following:INSERT INTO cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry 'uppercasegroup-10000' for key 2)) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:156) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:121) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:489) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:469) at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162) ... 15 more

            David Chan added a comment - - edited

            There was a case where new groups were not being added to JIRA. I could not reliably reproduce this, but there is something definitely going when 'Lower Case Output' and case-insensitive dbs.

            David Chan added a comment - - edited There was a case where new groups were not being added to JIRA. I could not reliably reproduce this, but there is something definitely going when 'Lower Case Output' and case-insensitive dbs.

              ahempel Adrian Hempel [Atlassian]
              dchan David Chan
              Affected customers:
              2 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: