Hello,
We are currently running *Community Edition Version 6.7.3 (build 38370) and attempting to upgrade it to *Community Edition Version 7.9.6 (build 41879). Our database is Oracle. During the upgrade process, we encountered an error:
ERROR web[][DbMigrations] #2104 'Create ALM_APP_INSTALLS table': failure | time=46ms
ERROR web[][DbMigrations] Executed DB migrations: failure | time=21728759ms
ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=21728856ms
ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #2104 'Create ALM_APP_INSTALLS table' failed at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79) at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)at java.base/java.lang.Iterable.forEach(Iterable.java:75) at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52) at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:68) at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105) at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Fail to execute CREATE UNIQUE INDEX alm_app_installs_owner ON alm_app_installs (alm_id, owner_id)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:97)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:77)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:117)
at org.sonar.server.platform.db.migration.version.v72.CreateAlmAppInstallsTable.execute(CreateAlmAppInstallsTable.java:87) at org.sonar.server.platform.db.migration.step.DdlChange.execute(DdlChange.java:45) at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75) ... 9 common frames omitted
Caused by: java.sql.SQLException: ORA-01450: maximum key length (6398) exceeded
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:931)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150)
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1792)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1745)
at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:334)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:82)
... 14 common frames omitted "
When attempting to resume the upgrade process after restarting the SonarQube service, the table creation appears to be successful but without the index. However, the upgrade process fails on the second table with the same error:
Create PROJECT_MAPPINGS table' failed.
CREATE UNIQUE INDEX key_type_kee ON project_mappings
Caused by: java.sql.SQLException: ORA-01450: maximum key length (6398) exceeded
When attempting to restart and continue the upgrade process, the second table is also created without the index. However, after some time, the upgrade process is completed successfully.
I guess you cannot say that those indices are not necessary and won’t cause any problems in the future
So
Any opinion/suggestion/workaround I don’t know anything, would be highly appreciated