Confluence Upgrade 3.2.1_01 to 3.5 - problem with database!

We are performing an Confluence upgrade and on the first startup there was an issue with the database. We are using Oracle 10g with ojdbc 1.4 driver. The following error occured in the logs and the upgrade did not complete.

2012-06-07 11:34:12,840 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Unsuccessful: alter table IMAGEDETAILS add constraint FKA768048734A4917E foreign key (ATTACHMENTID) references ATTACHMENTS
2012-06-07 11:34:12,841 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute ORA-02298: cannot validate (CONFLUENCE_ADM.FKA768048734A4917E) - parent keys not found

2012-06-07 11:34:12,843 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update
java.sql.SQLException: ORA-02298: cannot validate (CONFLUENCE_ADM.FKA768048734A4917E) - parent keys not found

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:961)

2 answers

1 accepted

Found solution:

select * from IMAGEDETAILS
LEFT JOIN (SELECT * FROM ATTACHMENTS) ats on ats.ATTACHMENTID = IMAGEDETAILS.ATTACHMENTID
WHERE CONTENTTYPE is null

delete from IMAGEDETAILS where ATTACHMENTID = <id>;

What do you enter in <id> ?

the ATTACHMENTID from the select, it will return all imagedetails with no corresponding attachments.

Hi Miroslav.

An easier way to do that in a single query is:

delete from IMAGEDETAILS where ATTACHMENTID not in (select ATTACHMENTID from ATTACHMENTS);

I'm late to this game. We had the some problem upgrading from Confluence 4.3 to 5.0.3.

What are these missing rows used for? What is the consequence of deleting them? Why were they missing in the first place?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Goff-Dupont
Published 4 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

56 views 2 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you