Description
Steps to reproduce
- Install any supported version of Crowd on Microsoft SQL Server;
- Attempt to upgrade to Crowd 3.3.0 using any available method (XML import or database);
Expected results
Upgrade completes successfully.
Actual results
The liquibase library queries the SYS.INDEXES object with uppercase, though it defaults to sys.indexes in lowecase in MSSQL.
Therefore, the upgrade fails and the following error appears in the application logs:
2018-10-03 10:01:33,066 localhost-startStop-1 ERROR [crowd.console.listener.StartupListener] Failed to initialise Crowd container java.lang.RuntimeException: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase/bootstrap/06_cwd_user.xml::EMBCWD-300: drop idx_user_lower_display_name before mutating constraints::crowd: Reason: liquibase/master.xml : Index Exists Precondition: idx_user_lower_display_name on cwd_user : Invalid object name 'SYS.INDEXES'. ... Caused by: java.sql.SQLException: Invalid object name 'SYS.INDEXES'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505) at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1427)
Workaround
Rename the affected objects to match the uppercase query.
Or upgrade to 3.2.5 instead.