ERROR Upgrade from 7.9.2 -> 8.6.1 Enterprise Edition #3533 'Populate 'metric_uuid' for 'PROJECT_MEASURES'': failure

Environment:
SonarQube Enterprise 7.9.1
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Operating System: Red Hat Enterprise Linux Server 7.9 (Maipo)
Java: jdk-11.0.4

Upgrade from zip SonarQube from 7.9.2 to SonarQube Enterprise 8.6.1

First error with step ‘3492’ but found solution here

but next is

2021.03.11 08:27:04 ERROR web[][DbMigrations] #3533 'Populate 'metric_uuid' for 'PROJECT_MEASURES'': failure | time=81ms
2021.03.11 08:27:04 ERROR web[][DbMigrations] Executed DB migrations: failure | time=81ms
2021.03.11 08:27:04 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=182ms
2021.03.11 08:27:04 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 #3533 'Populate 'metric_uuid' for 'PROJECT_MEASURES'' 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.lang.IllegalStateException: Error during processing of row: [uuid=AXgci7klGPog_g9EGttw,uuid=10035]
        at org.sonar.server.platform.db.migration.step.SelectImpl.newExceptionWithRowDetails(SelectImpl.java:89)
        at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:81)
        at org.sonar.server.platform.db.migration.step.MassUpdate.execute(MassUpdate.java:93)
        at org.sonar.server.platform.db.migration.version.v84.metrics.projectmeasures.PopulateProjectMeasuresMetricUuid.execute(PopulateProjectMeasuresMetricUuid.java:42)
        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: java.sql.BatchUpdateException: ORA-04098: trigger 'SONARUSER4UPGRADE.TRG_ADMD_PROJECT_MEASURES_MER' is invalid and failed re-validation

        at oracle.jdbc.driver.OraclePreparedStatement.executeLargeBatch(OraclePreparedStatement.java:9711)
        at oracle.jdbc.driver.T4CPreparedStatement.executeLargeBatch(T4CPreparedStatement.java:1447)
        at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9487)
        at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:237)
        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.addBatch(UpsertImpl.java:56)
        at org.sonar.server.platform.db.migration.step.MassUpdate.callSingleHandler(MassUpdate.java:120)
        at org.sonar.server.platform.db.migration.step.MassUpdate.lambda$execute$0(MassUpdate.java:93)
        at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:78)
        ... 13 common frames omitted

Please advice

Hi,

Could you try dropping the trigger SONARUSER4UPGRADE.TRG_ADMD_PROJECT_MEASURES_MER and resume the migration?

Hi @dmeneses,
Thank you, I can confirm that dropping the trigger resolved issue.

Best Regards

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