Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
7.4.8, 7.12.0
-
13
-
Severity 3 - Minor
-
3
-
Description
Problem
Importing an XML space backup with inconsistencies completes, even though there are problems with its contents.
Steps to Reproduce
- Create a space XML backup
- Extract the files and edit the entities.xml
- Replace all the lower space key entries with their upper case equivalents, example:
- Original:
<property name="key"><![CDATA[TST]]></property> <property name="lowerKey"><![CDATA[tst]]></property>
- Modified:
<property name="key"><![CDATA[TST]]></property> <property name="lowerKey"><![CDATA[TST]]></property>
- Original:
- Create a new zip with the modified file and import the space
Expected Results
The import fails due to that problem or the key is converted to lower case before inserting into the database (lowerspacekey from spaces).
Actual Results
The import does not throw any error on the UI, so it looks successful. The following can be seen in the atlassian-confluence.log:
2021-05-14 17:26:26,155 ERROR [Long running task: Importing data] [confluence.pages.ancestors.RebuildAncestorsPostImportTask] rebuildPageAncestors Could not load valid space for imported space key: TST -- url: /admin/restore.action | referer: http://localhost:8090/admin/backup.action | traceId: ea82dd8239cdce28 | userName: admin | action: restore 2021-05-14 17:26:26,192 WARN [AtlassianEvent::CustomizableThreadFactory-1] [gatekeeper.evaluator.cache.CacheUpdateSender] warn Space import for spaceKey TST did not import correctly. Unable to retrieve the space for permission cache update. -- url: /admin/restore.action | referer: http://localhost:8090/admin/backup.action | traceId: ea82dd8239cdce28 | userName: admin | action: restore 2021-05-14 17:26:26,196 INFO [Long running task: Importing data] [confluence.importexport.actions.ImportLongRunningTask] runInternal Finished import.
At this stage, the space is not functional. Trying to open pages results in 404 errors and neither the page tree nor the space tools load properly. Checking the database, you can confirm that the lowerspacekey column of the spaces table is holding the upper case key.
Workaround
- Stop Confluence
- Take a database backup
- Run the following query to set the lower space key:
Replace the key accordinglyupdate spaces set lowerspacekey = '<LOWERCASE-KEY>' where spacekey = '<UPPERCASE-KEY>';
- Restart Confluence
- Rebuild the indexes and the ancestors table as follows, one at a time:
Notes
This problem can easily happen when trying to change a space key as covered here:
During the XML manipulation, space keys can be renamed incorrectly leading to this issue.
Attachments
Issue Links
- relates to
-
CONFCLOUD-77442 XML Import Fails to Validate Mismatched Lowercase Space Keys
- Closed
-
CONFCLOUD-77707 Space becomes unavailable due to lowerspacekey having upper-case characters
- Closed