I successful updated sonar from 7.6 to 7.9.2 for update to 8.1 version.
But with update from 7.9.2 to 8.1 faced issue:
2020.02.17 14:36:52 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 #3003 'Populate ProjectQualityGate table from Properties 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 com.google.common.collect.ImmutableList.forEach(ImmutableList.java:405)
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.sql.BatchUpdateException: Batch entry 156 insert into project_qgates(project_uuid, quality_gate_uuid) VALUES ('AW_9IgHTAcZODALNP-5F', 'AXALxbfLAcZODALNP_tw') was aborted: ERROR: duplicate key value violates unique constraint "pk_project_qgates"
Detail: Key (project_uuid)=(AW_9IgHTAcZODALNP-5F) already exists. Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:148)
at org.postgresql.core.ResultHandlerDelegate.handleError(ResultHandlerDelegate.java:50)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2234)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:510)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:853)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1546)
at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:242)
at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:242)
at org.sonar.server.platform.db.migration.step.UpsertImpl.execute(UpsertImpl.java:68)
at org.sonar.server.platform.db.migration.version.v80.PopulateProjectQualityGatesTable.populateProjectQualityGates(PopulateProjectQualityGatesTable.java:62)
at org.sonar.server.platform.db.migration.version.v80.PopulateProjectQualityGatesTable.execute(PopulateProjectQualityGatesTable.java:49)
at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:44)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
... 9 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_project_qgates"
Detail: Key (project_uuid)=(AW_9IgHTAcZODALNP-5F) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)
... 19 common frames omitted
I tried to clean up projects in error project_uuid , but it show other one.
Could you please help to understand what “Populate ProjectQualityGate table from Properties table” do and why I got such issue…