"Query failed at: insert into mig_contentid" error during space migration
Summary
Learn how to resolve the error message "Query failed at: insert into mig_contentid_" when migrating spaces with the Confluence Cloud Migration Assistant (CCMA).
Overview
During a space migration with the CCMA, the space migration can fail with the below error message in the user interface:
Failed to export [cloudId=<cloud_id>,spaceKey=<spacekey>].
Error: Query failed at: insert into mig_contentid_tv2de693f75
The below signature is also found in the application log file atlassian-confluence.log:
ERROR [pool-0-thread-0] [agent.newexport.store.JdbcConfluenceStore] mutate Query failed at: insert into mig_contentid_tv2de693f75
...
Column 'id' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'id' cannot be null
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:87)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
...
The error indicates that a null value was passed to a field that cannot be null.
This mainly happens with the spacedescid column.
Solution
Run the below query in Confluence On-Premise to check if the column value is indeed null. Replace the "<spacekey>" in the last line with its actual value.
SELECT spacedescid FROM spaces WHERE spacekey = '<spacekey>';
- After confirming the result is null, edit the space description in the UI to something else (How to edit space details).
- Retry the space migration.