Confluence Space XML export fails with 'java.lang.IllegalArgumentException'
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
問題
The Confluence Space XML export (See: Export Content to Word, PDF, HTML and XML) fails with the following error.
java.lang.IllegalArgumentException: Table or field name is not allowed: dbo.CONTENTPROPERTIES
症状
A detailed exception is reported in the atlassian-confluence.log:
2024-05-21 13:50:34,153 WARN [ConfluenceBackupRestoreManager:thread-4] [confluence.impl.backuprestore.ConfluenceBackupRestoreManager] updateJobStateAfterCompletion Backup restore job BackupRestoreJob{id=425984002, jobOperation=BACKUP, jobScope=SPACE, jobState=PROCESSING, createTime=2024-05-21T11:50:34Z, startProcessingTime=2024-05-21T11:50:34Z, finishProcessingTime=null, cancelTime=null, owner='userkfnu', whoCancelledTheJob='null', errorMessage='null'} failed: java.lang.IllegalArgumentException: Table or field name is not allowed: dbo.CONTENTPROPERTIES -- url: /rest/api/backup-restore/backup/space | userName: userkfnu | referer: https://domain.xx/plugins/servlet/space-tool-backup/~userkfnu | traceId: 702d2dcb941ea29acom.atlassian.confluence.backuprestore.exception.BackupRestoreException: java.lang.Illega¯lArgumentException: Table or field name is not allowed: dbo.CONTENTPROPERTIES at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.doBackupSynchronously(SpaceBackupService.java:123) at com.atlassian.confluence.impl.backuprestore.BackupRestoreJobRunner.runJobSynchronously(BackupRestoreJobRunner.java:58)
at com.atlassian.confluence.impl.backuprestore.ConfluenceBackupRestoreManager.runJobAndUpdateJobProperties(ConfluenceBackupRestoreManager.java:271)
at com.atlassian.confluence.impl.backuprestore.ConfluenceBackupRestoreManager.processJobsFromTheQueue(ConfluenceBackupRestoreManager.java:250)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)Caused by: java.lang.IllegalArgumentException: Table or field name is not allowed: dbo.CONTENTPROPERTIES
at com.atlassian.confluence.impl.backuprestore.backup.exporters.DatabaseExporterHelper.checkNameDoesNotHaveSqlInjections(DatabaseExporterHelper.java:250)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ContentPropertyDataExporter.buildQuery(ContentPropertyDataExporter.java:47)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ContentPropertyDataExporter.<init>(ContentPropertyDataExporter.java:43)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ExporterFactory.createContentPropertySpaceExporter(ExporterFactory.java:86)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.SpaceExportersFactory.createContentPropertyExporter(SpaceExportersFactory.java:105)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.SpaceExportersFactory.createExporters(SpaceExportersFactory.java:52)
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.backupAllEntitiesAndAttachments(SpaceBackupService.java:155)
at com.atlassian.confluence.impl.backuprestore.backup.AbstractBackupService.performBackup(AbstractBackupService.java:76)
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.doBackupSynchronously(SpaceBackupService.java:106) {code}
原因
The presence of the property hibernate.default_schema in the confluence.cfg.xml file (See: Confluence Home and other important directories) can cause this error.
The hibernate.default_schema property (<property name="hibernate.default_schema">[confluence_schema]</property>) specifies the default schema for databases, mostly Oracle and MS SQL Server databases within confluence.cfg.xml. This means that if a database object (like a table) is referenced without a schema, Hibernate will use the one defined by hibernate.default_schema.
However, in Confluence, we already set DEFAULT_SCHEMA (See: Database Setup for SQL Server) for the Confluence user at the database level and the additional property of hibernate.default_schema can cause issues with SQL injection rules.
ソリューション
- Stop the Application.
Remove below property from confluence.cfg.xml:
<property name="hibernate.default_schema">[confluence_schema]</property>
アプリケーションを開始します。
Rerun the Space XML export.