Migrating Confluence attachments storage from database to file system fails with InputStream cannot be null.
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
要約
Attempting to export the attachments from the database to the file system fails.
環境
Confluence server and Datacenter
診断
Confluence server had an option to store the attachment files in the database. In Confluence 5.5 it was deprecated and we provide an option to migrate the attachments from the database to the file system. This KB treats an issue with the migration process and is only applicable in this scenario.
The following error appears in the atlassian-confluence.log when attempting to migrate the attachments from the database to the file system:
ERROR [Long running task: Attachment data migration] [confluence.util.longrunning.AttachmentMigrationLongRunningTask] runInternal inputStream cannot be null
-- url: /wiki/admin/doattachmentmigration.action | referer: Confluence_base_URL/admin/doeditattachmentstorage.action | traceId: ada3fdd04c8e8490 | userName: admin| action: doattachmentmigration
java.lang.NullPointerException: inputStream cannot be null
原因
There are missing attachments in the attachmentdata table on the database. The migration process fails when it attempts to read the missing data.
ソリューション
Remove the missing rows using the steps below.
Always perform a full database backup before running any SQL commands.
Confluence をシャットダウンします。
- Backup the database
Run this SQL command to identify the NULL rows
select attachmentdataid from attachmentdata where data is NULL;
Run the command below to remove the NULL rows
delete from attachmentdata where data is NULL;
- Confluence を再起動します。
- Attempt a new migration process.