Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-22298

OS_PROPERTYENTRY User Property Settings Lost after Upgrade to Confluence 3.5 or higher

XMLWordPrintable

      Summary

      After upgrading to Confluence 3.5 or higher, where the user property migration (e.g. com.atlassian.confluence.user.migration.AtlassianUserDataMigrator#migrateUserProperties or com.atlassian.user.util.migration.OSUCrowdEntityMigrator#migratePropertySet) won't happen/called during the upgrade which is expected for the following scnearios:

      .....user settings (confluence.user.*) in OS_PROPERTYENTRY table will be lost such as:

      • Profile picture
      • Default setting of editor (wikimarkup/RTE)
      • User site home page
      • Login details
      • etc.
      Workaround

      Go here.

      Possible Cause

      The upgrade process does not migrate the respective entities in OS_PROPERTYENTRY table. They are no more taken into account due to different structure - previously the entity_name is OSUser_user (and entity_id set to JIRA's userbase.id) and now is CWD_username (entity_id set to 0).

      • Mismapped OS_PROPERTYENTRY entries of JIRA users
        +---------------+-----------+---------------------------------------------+----------+-------------+------------+-------------------------------------+----------+----------+---------+---------------------+
        | entity_name   | entity_id | entity_key                                  | key_type | boolean_val | double_val | string_val                          | text_val | long_val | int_val | date_val            |
        +---------------+-----------+---------------------------------------------+----------+-------------+------------+-------------------------------------+----------+----------+---------+---------------------+
        | OSUser_user   |     10000 | confluence.user.last.login.date             |        7 |             |          0 | NULL                                |          |        0 |       0 | 2011-04-12 03:45:37 |
        | OSUser_user   |     10000 | confluence.user.previous.login.date         |        7 |             |          0 | NULL                                |          |        0 |       0 | 2011-04-12 03:42:12 |
        | OSUser_user   |     10000 | confluence.user.profile.picture             |        5 |             |          0 | /images/icons/profilepics/dude1.gif |          |        0 |       0 | NULL                |
        | OSUser_user   |     10010 | confluence.user.last.login.date             |        7 |             |          0 | NULL                                |          |        0 |       0 | 2011-04-12 03:42:22 |
        | OSUser_user   |     10010 | confluence.user.previous.login.date         |        7 |             |          0 | NULL                                |          |        0 |       0 | 2011-03-18 21:26:59 |
        | OSUser_user   |     10010 | confluence.user.profile.picture             |        5 |             |          0 | stylesheets.jpg                     |          |        0 |       0 | NULL                |
        | OSUser_user   |     10011 | confluence.user.last.login.date             |        7 |             |          0 | NULL                                |          |        0 |       0 | 2011-03-18 21:27:54 |
        | OSUser_user   |     10011 | confluence.user.previous.login.date         |        7 |             |          0 | NULL                                |          |        0 |       0 | 2011-03-17 21:36:41 |
        | OSUser_user   |     10011 | confluence.user.profile.picture             |        5 |             |          0 | jbb-95295-pp-ochenklogo.jpg         |          |        0 |       0 | NULL                |
        +---------------+-----------+---------------------------------------------+----------+-------------+------------+-------------------------------------+----------+----------+---------+---------------------+
        
      • New structure:
        +---------------+-----------+---------------------------------------------+----------+-------------+------------+-----------------------------------------+----------+----------+---------+---------------------+
        | entity_name   | entity_id | entity_key                                  | key_type | boolean_val | double_val | string_val                              | text_val | long_val | int_val | date_val            |
        +---------------+-----------+---------------------------------------------+----------+-------------+------------+-----------------------------------------+----------+----------+---------+---------------------+
        | CWD_adminconf |         0 | confluence.user.keyboard.shortcuts.disabled |        1 |             |          0 | NULL                                    |          |        0 |       0 | NULL                |
        | CWD_adminconf |         0 | confluence.user.last.login.date             |        7 |             |          0 | NULL                                    |          |        0 |       0 | 2011-04-12 04:03:42 |
        | CWD_adminconf |         0 | confluence.user.previous.login.date         |        7 |             |          0 | NULL                                    |          |        0 |       0 | 2011-04-12 04:00:38 |
        | CWD_adminconf |         0 | confluence.user.profile.picture             |        5 |             |          0 | /images/icons/profilepics/Avatar-15.png |          |        0 |       0 | NULL                |
        | CWD_adminconf |         0 | confluence.user.site.homepage               |        5 |             |          0 | ds                                      |          |        0 |       0 | NULL                |
        | CWD_adminconf |         0 | confluence.user.time.zone                   |        5 |             |          0 | Asia/Kuala_Lumpur                       |          |        0 |       0 | NULL                |
        | CWD_adminconf |         0 | confluence.user.whats.new.dont.show.version |        5 |             |          0 | 3.5                                     |          |        0 |       0 | NULL                |
        +---------------+-----------+---------------------------------------------+----------+-------------+------------+-----------------------------------------+----------+----------+---------+---------------------+
        
      Finding
      • The lost profile pictures will still be available in the selection of profile pictures, but not applied (only for the uploaded profile pictures).
      • It seems that OS_PROPERTYENTRY.ENTITY_NAME is a combination of CWD_ and CWD_USER.LOWER_USER_NAME. However, it seems that Confluence expects it differently, CWD_ and CWD_USER.USER_NAME. So if the user has a different case username in CWD_USER.USER_NAME:
        CWD_USER.USER_NAME CWD_USER.LOWER_USER_NAME OS_PROPERTYENTRY.ENTITY_NAME
        TestUser testuser CWD_testuser

        The above seems the default, but it won't work. You'll need to workaround it by changing OS_PROPERTYENTRY.ENTITY_NAME to CWD_TestUser

      • Confluence will throw this error in the log after upgrade:
        2011-04-12 03:49:03,442 ERROR [Indexer: 2] [atlassian.bonnie.search.BaseDocumentBuilder] getDocument Error extracting search fields from Attachment: jbb-95295-pp-ochenklogo.jpg v.1 (983042) jbb using BackwardsCompatibleExtractor wrapping com.atlassian.confluence.search.lucene.extractor.ConfluenceAttachmentMetadataExtractor@15a7085 (confluence.extractors.core:attachmentMetadataExtractor): value cannot be null
        java.lang.NullPointerException: value cannot be null
        	at org.apache.lucene.document.Field.<init>(Field.java:330)
        	at org.apache.lucene.document.Field.<init>(Field.java:305)
        	at org.apache.lucene.document.Field.<init>(Field.java:284)
        	at com.atlassian.confluence.search.lucene.extractor.ConfluenceAttachmentMetadataExtractor.addFields(ConfluenceAttachmentMetadataExtractor.java:66)
        	at com.atlassian.confluence.plugin.descriptor.ExtractorModuleDescriptor$BackwardsCompatibleExtractor.addFields(ExtractorModuleDescriptor.java:45)
        	at com.atlassian.bonnie.search.BaseDocumentBuilder.getDocument(BaseDocumentBuilder.java:104)
        	at com.atlassian.confluence.search.lucene.ConfluenceDocumentBuilder.getDocument(ConfluenceDocumentBuilder.java:102)
        	at com.atlassian.confluence.search.lucene.tasks.AddDocumentIndexTask.perform(AddDocumentIndexTask.java:43)
        	at com.atlassian.bonnie.index.TempIndexWriter.perform(TempIndexWriter.java:73)
        	at com.atlassian.confluence.search.lucene.TempIndexWriterStrategy.perform(TempIndexWriterStrategy.java:43)
        	at com.atlassian.confluence.search.lucene.tasks.TempIndexBackedIndexTaskPerformer.perform(TempIndexBackedIndexTaskPerformer.java:21)
        	at com.atlassian.confluence.search.lucene.DefaultObjectQueueWorker.indexCollection(DefaultObjectQueueWorker.java:78)
        	at com.atlassian.confluence.search.lucene.DefaultObjectQueueWorker$1.doInTransactionWithoutResult(DefaultObjectQueueWorker.java:62)
        	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
        	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
        	at com.atlassian.confluence.search.lucene.DefaultObjectQueueWorker.run(DefaultObjectQueueWorker.java:51)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        	at java.lang.Thread.run(Thread.java:662)
        

              shaffenden Steve Haffenden (Inactive)
              halatas HuseinA
              Votes:
              10 Vote for this issue
              Watchers:
              19 Start watching this issue

                Created:
                Updated:
                Resolved: