-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
6.14.2, 6.15.1, 6.15.2
-
None
-
21
-
Severity 3 - Minor
-
0
-
Issue Summary
Unable to install/uninstall apps appropriately after migrating from Atlassian Cloud.
Steps to Reproduce
- Migrate from Confluence Cloud to Server
- Try to install app (e.g. Team Calendars)
- 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>{"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"]} </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, ',"accountId":"anonymous"', '') 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, ',"accountId":"Unknown user"', '') 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.