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

Unable to manage apps appropriately after migrating from Atlassian Cloud

XMLWordPrintable

      Issue Summary

      Unable to install/uninstall apps appropriately after migrating from Atlassian Cloud.

      Steps to Reproduce

      1. Migrate from Confluence Cloud to Server
      2. Try to install app (e.g. Team Calendars)
      3. Try to uninstall the app

      Expected Results

      The app can be installed/uninstalled without any problem.

      Actual Results

      When you try to install Team Calendars, you will see the following error. (However, the app is actually installed.)

      You will see the following error in atlassian-confluence.log.

      2019-04-09 02:13:35,771 WARN [UpmAsynchronousTaskManager:thread-4] [rest.resources.install.InstallTask] run Unexpected error in install task
       -- url: /rest/plugins/1.0/ | referer: http://conf6151.localtest.me:8090/plugins/servlet/upm/marketplace/search?q=team%20cal | traceId: d84b6ea6362d50ff | userName: recovery_admin
      java.lang.RuntimeException: Failed to parse AuditLogEntry from JSON string: {"userKey":"","accountId":"anonymous","date":1553834285704,"i18nKey":"upm.auditLog.install.plugin.success","entryType":"PLUGIN_INSTALL","params":["Jira Ops integration","jira-ops-confluence-integration","1.0.4-AC"]}
      

      When you try to uninstall Team Calendars, the uninstallation seems to succeeded. However, if you restart Confluence instance, the app is still listed in Manage apps page.

      Notes

      This problem is caused by the data which is imported from Cloud.

      select bandanavalue FROM bandana WHERE bandanakey like 'com.atlassian.upm.log.PluginSettingsAuditLogService:log:upm_audit_log_v3';
      
      <list>
        <string>{&quot;userKey&quot;:&quot;&quot;,&quot;accountId&quot;:&quot;anonymous&quot;,&quot;date&quot;:1553834285704,&quot;i18nKey&quot;:&quot;upm.auditLog.install.plugin.success&quot;,&quot;entryType&quot;:&quot;PLUGIN_INSTALL&quot;,&quot;params&quot;:[&quot;Jira Ops integration&quot;,&quot;jira-ops-confluence-integration&quot;,&quot;1.0.4-AC&quot;]} 
       </string>
        ...
      </list>
      

      The strings are HTML escaped but they contained the following JSON data.

      {"userKey":"","accountId":"anonymous","date":1553834285704,"i18nKey":"upm.auditLog.install.plugin.success","entryType":"PLUGIN_INSTALL","params":["Jira Ops integration","jira-ops-confluence-integration","1.0.4-AC"]}
      

      A key "accountId" is only used in Confluence Cloud and it shouldn't exist in Confluence Server.

      Workaround

      Please remove the key "accountId" from the problematic record with SQL below. (This SQL is tested on PostgreSQL.)

      update bandana set bandanavalue = replace(bandanavalue, ',&quot;accountId&quot;:&quot;anonymous&quot;', '') where bandanakey like 'com.atlassian.upm.log.PluginSettingsAuditLogService:log:upm_audit_log_v3';
      

      If you've installed some apps on Confluence Cloud, you also need to execute the following SQL.

      update bandana set bandanavalue = replace(bandanavalue, ',&quot;accountId&quot;:&quot;Unknown user&quot;', '') where bandanakey like 'com.atlassian.upm.log.PluginSettingsAuditLogService:log:upm_audit_log_v3';
      

      Please make sure to take a backup before modifying the DB record.

        1. screenshot-1.png
          527 kB
          Yuki Okamoto

              Unassigned Unassigned
              yokamoto Yuki Okamoto (Inactive)
              Votes:
              17 Vote for this issue
              Watchers:
              21 Start watching this issue

                Created:
                Updated: