SonarQube Update 8.4 failed PERM_TEMPLATES_GROUPS

Hi,
I tried to update our sonarqube community instance from 8.2 to 8.4. First updated to 8.3, no problem. But update to 8.4 failed in the database migration process. The migration ended with an exception: ‘Drop primary key on ‘ID’ column of ‘PERM_TEMPLATES_GROUPS’ table’ failed.
So I had to recover my database backup and roll back to 8.3. I did a backup on the corrupted database of version 8.4. What can I do to solve the migration problem and to update successfully to 8.4?

Installed plugins:
C# Code Quality and SecurityLanguages
Code Analyzer for C#

GitIntegration
Git SCM Provider for SonarQube

JaCoCoLanguages
JaCoCo XML report importer

Java Code Quality and SecurityLanguages
Code Analyzer for Java

MyBatis Plugin for SonarQubeExternal Analysers
Rules to check SQL statements in MyBatis Mapper XML files

SonarCSSLanguages
Code Analyzer for CSS

SonarFlexLanguages
Code Analyzer for Flex / ActionScript

SonarGoLanguages
Code Analyzer for Go

SonarHTMLLanguages
Code analyzer for HTML

SonarJSLanguages
Code Analyzer for JavaScript

SonarKotlinLanguages
Code Analyzer for Kotlin

SonarPHPLanguages
Code Analyzer for PHP

SonarPython
Code Analyzer for Python

SonarRubyLanguages
Code Analyzer for Ruby

SonarScalaLanguages
Code Analyzer for Scala

SonarTSLanguages
Code Analyzer for TypeScript

SonarXMLLanguages
Code Analyzer for XML

SvnIntegration
Subversion SCM Provider for SonarQube

VB.NET Code Quality and SecurityLanguages
Code Analyzer for VB.NET

Hi,

Welcome to the community!

In fact, 8.4.1 was released last week to address migration problems, among a couple other bugs. Please try with it and let us know if you still have problems.

 
Ann

I did the update to 8.4.1 and the migration process still fails.Exception is still the same.

2020.07.29 12:15:53 ERROR web[][DbMigrations] #3492 'Drop primary key on 'ID' column of 'PERM_TEMPLATES_GROUPS' table': failure | time=39ms
2020.07.29 12:15:53 ERROR web[][DbMigrations] Executed DB migrations: failure | time=8644ms
2020.07.29 12:15:53 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=8779ms
2020.07.29 12:15:53 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 #3492 'Drop primary key on 'ID' column of 'PERM_TEMPLATES_GROUPS' 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.lang.IllegalStateException: Fail to execute DROP TRIGGER perm_templates_groups_IDT
        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.v84.common.DropPrimaryKeyOnIdColumn.execute(DropPrimaryKeyOnIdColumn.java:39)
        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)
        ... 9 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: ORA-04080: Trigger 'PERM_TEMPLATES_GROUPS_IDT' ist nicht vorhanden

        at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
        at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:37)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:896)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)
        at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1737)
        at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1692)
        at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:300)
        at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
        at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
        at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:91)
        ... 14 common frames omitted
Caused by: oracle.jdbc.OracleDatabaseException: ORA-04080: Trigger 'PERM_TEMPLATES_GROUPS_IDT' ist nicht vorhanden

        at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
        ... 29 common frames omitted

What can I do to investigate on the problem? Do you need any further data?

Any suggestions?

@pierreguillot?

Hi, can you show us the structure of the PERM_TEMPLATES_GROUPS_IDT table please? (including indexes, primary key and trigger)

@pierreguillot
schema:
schema

contraints:

indexes:

@pierreguillot Any new insights?

It’s strange that you have the ID column, with the correct index, but no associated trigger. A workaround you can try:

  • run the database migration until it fails at step 3492
  • Manually delete the 'ID' is not null constraint
  • Manually delete the index in the ID column
  • Execute this insert query insert into schema_migrations (version) values ('3492')
  • Resume the migration (restart SonarQube)

Thje migration should continue with the next steps.