Schema Update could not Complete
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
*Except Fisheye and Crucible
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
*Except Fisheye and Crucible
Symptoms
While upgrading Confluence, the process stops with an error message stating execute could not complete schema update
The following appears in the atlassian-confluence.log
:
2014-08-08 14:34:09,409 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Unsuccessful: alter table BODYCONTENT add constraint FKA898D4778DD41734 foreign key (CONTENTID) references CONTENT
2014-08-08 14:34:09,419 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute ORA-02298: cannot validate (CONFLUENCE35.FKA898D4778DD41734) - parent keys not found
2014-08-08 14:34:09,423 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update
Cause
The upgrade process failed while trying to process corrupted orphaned pages.
Resolution
To verify this is the issue, we can use the following SQL query:
SELECT bodycontentid FROM bodycontent WHERE contentid NOT IN (SELECT contentid FROM content);
If there are any results they can be removed using:
DELETE FROM bodycontent WHERE bodycontentid IN (SELECT bodycontentid FROM bodycontent WHERE contentid NOT IN (SELECT contentid FROM content));
As this involves directly modifying the database, ensure you backup the database before making any changes.