Execution of migration step #6001 'Drop 'manual_measures_component_uuid' index' failed

Getting the following error in the web.log while trying to upgrade from SonarQube version 8.9.2 to 9.9.0. We are using postgres version 11. After upgrading the application, start sonar service and browse /setup and hit DB upgrade. Any help or hint is really appreciated.

2023.05.09 16:25:47 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2023.05.09 16:27:02 INFO  web[][o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2023.05.09 16:27:02 INFO  web[][DbMigrations] Executing DB migrations...
2023.05.09 16:27:02 INFO  web[][DbMigrations] #6001 'Drop 'manual_measures_component_uuid' index'...
2023.05.09 16:27:02 ERROR web[][DbMigrations] #6001 'Drop 'manual_measures_component_uuid' index': failure | time=17ms
2023.05.09 16:27:02 ERROR web[][DbMigrations] Executed DB migrations: failure | time=20ms
2023.05.09 16:27:02 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=66ms
2023.05.09 16:27:02 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 #6001 'Drop 'manual_measures_component_uuid' index' 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 com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
        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:66)
        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:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalArgumentException: Index name length can't be more than 30
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:407)
        at org.sonar.server.platform.db.migration.def.Validations.checkDbIdentifier(Validations.java:215)
        at org.sonar.server.platform.db.migration.def.Validations.validateIndexNameIgnoreCase(Validations.java:194)
        at org.sonar.server.platform.db.migration.step.DropIndexBuilder.build(DropIndexBuilder.java:59)
        at org.sonar.server.platform.db.migration.step.DropIndexChange.lambda$execute$0(DropIndexChange.java:44)
        at java.base/java.util.Optional.ifPresent(Optional.java:178)
        at org.sonar.server.platform.db.migration.step.DropIndexChange.execute(DropIndexChange.java:41)
        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)

Hello,

This is an error that other users have encountered, and in their case, the issue was that indexes were renamed by an external tool. For 9.9 we deployed a way to find these renamed indexes, but it would still cause an issue if the renamed index was too long.
This was in turn fixed in 9.9.1.
As a first step, I would suggest trying the migration again with the 9.9.1 version which is the currently available LTS. If that does not solve the issue, please come back for further help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.