SonarQube 9.9 LTS DB migration issue

Make sure to tell us:

  • What version are you upgrading from?
  • System information (Operating system, Java version, Database provider/version)
    Java 17, PostgreSQL 12.8 version
  • What’s the issue you’re facing?
    We are currently running SonarQube Developer Edition – version 9.4 and looking at upgrading to LTS 9.9 version.

However, during our staging upgrade we have encountered an issue with performing manual upgrade of the db.
We get the following error message:

org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #6603 'Drop index for 'project_uuid' in 'components'' failed

        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(

        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(


        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(

        at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(

        at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(

        at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(

        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(

at java.base/java.util.concurrent.ThreadPoolExecutor$

        at java.base/

Caused by: java.lang.IllegalArgumentException: Index name length can't be more than 30


        at org.sonar.server.platform.db.migration.def.Validations.checkDbIdentifier(

        at org.sonar.server.platform.db.migration.def.Validations.validateIndexNameIgnoreCase(


        at org.sonar.server.platform.db.migration.step.DropIndexChange.lambda$execute$0(

        at java.base/java.util.Optional.ifPresent(

        at org.sonar.server.platform.db.migration.step.DropIndexChange.execute(

        at org.sonar.server.platform.db.migration.step.DdlChange.execute(

        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(

        ... 9 common frames omitted

Seems like its due to the length of our index names. We are running PostgreSQL 12.8 version and based on the available documentation our index names can be up to 63 characters not 30.
After some investigation we found the limit set on your side: sonarqube/ at 8937c9305a7d8693b5e3771439404238672913b1 · SonarSource/sonarqube · GitHub


Welcome to the community, and thanks for this report!

It looks like you’re hitting this:

SONAR-18502 Database migration fails to drop indexes with long generated names

It will be fixed in 10.0. I’m not sure yet whether we’ll back-port it to 9.9 (altho I believe that’s likely).

In the meantime, you’ll want to either restore your DB backup and wait to upgrade, or manually delete the index.


1 Like