'Foreign key has implicit reference to object which does not have a primary key defined on it' error is thrown during Confluence upgrade

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When upgrading, Confluence is inaccessible after startup. An error appears in the logs like:

2010-08-26 15:14:49,975 ERROR [Thread-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update
java.sql.SQLException: Foreign key 'FK93247246F73AEE0F' has implicit reference to object 'os_user' which does not have a primary key defined on it.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)

Cause

Foreign keys are missing. Atlassian currently believes this is due to a server or database migration in which the SQL dump did not contain foreign keys.

Resolution

 

  1. From the old instance, take an XML backup.
  2. Create a new, blank database with a new Confluence instance (of the destination version). Use the Confluence Setup Guide.
  3. Import your XML backup from step 1 during the setup wizard.
Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.