SonarQube Community Edition 26.1 Docker Image with posgresql DB as backend Fails Migration

SonarQube Community Edition 26.1 Docker Image with posgresql DB as backend Fails Migration …

The error is

sonar DB migration failed | time=97ms 2026.01.07 02:33:29 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 #202506027 'Add 'part_number' column to 'ce_task_input'' failed at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:105)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:89)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:66)
    at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:55)
    at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:106)
    at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:81)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.IllegalStateException: Fail to execute ALTER TABLE ce_task_input DROP CONSTRAINT ce_task_input_task_uuid_not_null at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:106)
    at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:86)
    at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:128)
    at org.sonar.server.platform.db.migration.version.v202506.AddPartNumberColumnToCeTaskInputTable.execute(AddPartNumberColumnToCeTaskInputTable.java:57)
    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:101) 
    ... 8 common frames omitted 
Caused by: org.postgresql.util.PSQLException: ERROR: column "task_uuid" is in a primary key at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2736)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2421)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:525)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:357)
    at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:342)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:318)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:313)
    at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
    at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
    at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:91) 
    ... 13 common frames omitted

Hi,

Welcome to the community!

It looks like you’re trying to use Postgres 18. That’s not supported yet. If you’ll downgrade to Postgres 17 this should work for you.

 
HTH,
Ann

Docs telling us PG 14-18 ?

Hi,

26.2 should support 18, I believe. It looks like we were a bit aggressive with the docs update.

 
Ann

Thanks for the Info :slight_smile:

I believed in the docs and I tried and it made a big mess … very disappointed .. I had to waste a lot of time to restore the old version.

Gur

My apologies, the update about support for 14-18 was merged into the the SonarQube Community Build docs early, instead of with the other updates for 26.2 release.

The docs linked above are for SonarQube Server 2026.1, which does in fact support 14-18

But the migration code did not work … so it does not work for sure … I had to do my runbook for roll back to 25.12

Sry for the wrong link. Here its from the community version, which also states 14-18 Installing database | SonarQube Community Build | Sonar Documentation

We only maintain docs for the most recent release of SonarQube Community Build docs, to prevent other users from being confused, I have added a note to that page stating that the support for versions 14-18 support starts in 26.2