Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

upgrade from confluence 5.6 to 6.13 fails with org.hibernate.exception.SQLGrammarException


I have upgraded confluence 5.6 to 6.13.
I already fixed a number of errors before, such as setting <property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property> in confluence.cfg.xml, changing the database and HTTP threads, JVM memory requirements etc.

We have an embedded database (I think), at least
conf/server.xml does not list any of mysql, oracle, microsoft or postgresql
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
<Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true">
<!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/ -->
<Manager pathname=""/>
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>

<Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy" debug="0"
reloadable="false" useHttpOnly="true">
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>

After upgrading and the above mentioned fixes, I now get the following error message in the webbrowser:
Upgrade failed. Please consult the system logs for details. You will need to fix these problems, restore your database and confluence home directory to the pre upgrade state. Then retry the upgrade. Upgrade error message: Upgrade task com.atlassian.confluence.upgrade.upgradetask.RelationConstraintsPreSchemaUpgradeTask@311518cd failed during the SCHEMA_UPGRADE phase due to: StatementCallback; bad SQL grammar [SELECT CONSTRAINTS.TABLE_NAME, CONSTRAINT_NAME, COLUMNS.COLUMN_NAME FROM INFORMATION_SCHEMA.CONSTRAINTS, INFORMATION_SCHEMA.COLUMNS WHERE COLUMNS.TABLE_NAME = 'USERCONTENT_RELATION' AND CONSTRAINT_TYPE = 'UNIQUE' AND COLUMNS.TABLE_NAME = CONSTRAINTS.TABLE_NAME AND COLUMN_LIST REGEXP concat('^', COLUMNS.COLUMN_NAME, ',|,', COLUMNS.COLUMN_NAME, ',|,', COLUMNS.COLUMN_NAME, '$|^', COLUMNS.COLUMN_NAME, '$')]; nested exception is java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: CONSTRAINTS
2019-10-11 20:57:16 error
Unable to start up Confluence. Fatal error during startup sequence: confluence.lifecycle.core:mananagedjobs (Start and stop the Managed Scheduled Jobs)
2019-10-11 20:59:12 fatal could not prepare statement; SQL [select as id1_51_, schedulerr0_.job_id as job_id2_51_, schedulerr0_.start_time as start_ti3_51_, schedulerr0_.duration as duration4_51_, schedulerr0_.outcome as outcome5_51_, schedulerr0_.message as message6_51_ from scheduler_run_details schedulerr0_ where schedulerr0_.job_id=? order by schedulerr0_.start_time desc limit ?]; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement

I would appreciate any help.

Thanks a lot

- Michael

2 answers

1 vote

Hello Michael,

Thank you for contacting us about this.

The Confluence Embedded H2 database is only meant to be used during evaluation, and is not supported in the case of upgrade.

My recommendation would be to first roll back your upgrade by restoring the last site backup you made prior to the upgrade. Next step would then be to migrate away from the H2 database to a supported database.

Once you confirm the migration worked, then you can proceed with your upgrade.

Let me know if you have any trouble with that!



OK, thanks, I'll give that a try.

btw: We have been using the build-in H2 database for almost a decade now without any problems. Therefore I assumed it would also work with upgraded confluence versions (as it did in the past).


Thank you for confirming that!

It's definitely possible to continue to run Confluence on the evaluation database, but it's not recommended as there would be no way to recover the data should it become corrupt, and it can cause other issues with performance. The particular error you are running into is a common issue with the evaluation database and is solved by migrating to a supported production database.



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

494 views 24 9
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you