-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
Low
-
None
-
Affects Version/s: 7.4.11, 7.13.0
-
Component/s: Site - Backup / Import
-
16
-
Severity 3 - Minor
-
1
Issue Summary
Because of bug CONFSERVER-74539 Confluence allows attachments with a file name with just blanks spaces.
If this situation exists on an XML export, then the import fails with a NullPointerException.
Steps to Reproduce
- Install a vanilla instance of Confluence.
- This was validated on Confluence 7.13.0 and 7.4.11.
- Create a page with an attachment.
- Change the attachment name to just blank spaces.
- See additional instructions on bug CONFSERVER-74539.
- Go to Cog icon > General configuration > Backup & Restore.
- Create a site export.
- Move the generated export .zip file to <confluence-home>/restore
- Go to Cog icon > General configuration > Backup & Restore.
- Import the XML file.
Expected Results
Confluence completes the import, gracefully dealing with an attachment with just spaces as the title and lowertitle.
Actual Results
The import fails, mostly at the end of the operation >80%.
The following entries are found on the application logs.
2021-11-01 22:30:16,349 ERROR [Long running task: Importing data] [confluence.importexport.xmlimport.BackupImporter] importEntities Cannot import the entities: -- url: /c7130/longrunningtaskxml.action | referer: http://localhost:27130/c7130/admin/restore-local-file.action | traceId: 7596f26feabbc969 | userName: admin | action: longrunningtaskxml java.lang.NullPointerException at com.atlassian.confluence.importexport.xmlimport.BackupImporter.doSpecialProcessing(BackupImporter.java:517) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.postProcess(BackupImporter.java:433) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:405) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEverything(BackupImporter.java:371) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importEverything(FileBackupImporter.java:170) at com.atlassian.confluence.importexport.xmlimport.BackupImporter$1.doInTransactionWithoutResult(BackupImporter.java:262) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:36) at com.atlassian.confluence.importexport.xmlimport.RestorePluginStateStoreTransactionCallbackDecorator.doInTransaction(RestorePluginStateStoreTransactionCallbackDecorator.java:49) at com.atlassian.confluence.importexport.xmlimport.RestoreBandanaValuesTransactionCallbackDecorator.doInTransaction(RestoreBandanaValuesTransactionCallbackDecorator.java:56) (...) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) (...) 2021-11-01 22:30:16,356 ERROR [Long running task: Importing data] [confluence.importexport.actions.ImportLongRunningTask] runInternal Failure during import -- url: /c7130/longrunningtaskxml.action | referer: http://localhost:27130/c7130/admin/restore-local-file.action | traceId: 7596f26feabbc969 | userName: admin | action: longrunningtaskxml com.atlassian.confluence.importexport.ImportExportException: java.lang.NullPointerException at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:410) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEverything(BackupImporter.java:371) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importEverything(FileBackupImporter.java:170) at com.atlassian.confluence.importexport.xmlimport.BackupImporter$1.doInTransactionWithoutResult(BackupImporter.java:262) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:36) (...) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException at com.atlassian.confluence.importexport.xmlimport.BackupImporter.doSpecialProcessing(BackupImporter.java:517) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.postProcess(BackupImporter.java:433) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:405) ... 38 more
Workaround
If the source instance is still available, then the administrator can:
- Search for the attachments on which the file name is just blank spaces.
- See the details on CONFSERVER-74539.
- Change the file name to something meaningful.
- Create a new export.
If the source instance isn't available anymore then the administrator can manually edit the entities.xml file of the available XML export, changing the attachment name directly in the file and creating a new .zip file with the modified entities.xml.
You may choose opening a request to Atlassian Support to get help identifying this situation and making the appropriate changes to that file.
One alternative to search for the affected attachments is to run a query at the database level to find all of them. Here's an example of a query to search for attachments with blank spaces as names in an Oracle database:
SELECT * FROM content WHERE contenttype = 'ATTACHMENT' AND TRIM(title) IS NULL;
- is related to
-
CONFSERVER-74539 Changing the title of an attachment on Confluence to just blank spaces doesn't result on an error and commits the change on the database
-
- Closed
-
- mentioned in
-
Page Loading...