Upgrading Confluence from 3.4.x to 3.5.x or never will throw an error - Bad SQL Grammar Nested Exception Invalid Object Name 'cwd_application'
After upgrading Confluence from 3.4.x or an older version to 3.5.x or a newer version, the following error appears.
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Unable to perform find; bad SQL grammar ; nested exception is java.sql.SQLException: Invalid object name 'cwd_application'. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:107) caused by: java.sql.SQLException: Invalid object name 'cwd_application'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
Additionally, if a user tries to log in, a similar error can occur but this time pointing to the
CWD_* tables weren't created properly in the upgrade process.
In 3.5.x, new user management was introduced using Crowd architecture to manage users in Confluence and implementing user directories in order to facilitate user management and integration between applications.
There are some known causes for that:
- The database from an older version was imported directly into 3.5.x or newer Confluence version database and thus, the upgrade automated steps didn't run as expected.
- The build number (<confluence-home>/confluence.cfg.xml) from the current version of Confluence is incorrect and this won't trigger the upgrade steps.
- The primary keys on the database do not exist. Can occur more often in SQL server but could also happen in other databases.
Resolution for cause 1
- Confluence をシャットダウンします。
- Rollback Confluence to the previous version before the upgrade attempt. (Restore the database backup and home_folder backup)
Proceed with the upgrade steps exactly as in the upgrade documentation.
Resolution for cause 2
- Rollback your database to a point pre-upgrade.
- Run this query to remove the rows of the extra buildnumbers:
Note: Where ? is the CONFVERSIONIDof all extra buildnumbers.
データベースの変更を行う場合は必ず事前に可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。
Be sure that the correct buildnumber of your current Confluence version is set into your confluence.cfg.xml file, which is located at Confluence home.
- Try to proceed with the upgrade again.
Resolution for cause 3
- Confluence をシャットダウンします。
Rollback Confluence to the previous version before the upgrade attempt. (Restore the database backup and home_folder backup)
- Create an XML backup and import it into a new Confluence instance with the same version.
- Proceed with the upgrade steps exactly as in the upgrade documentation.