10.3 (ms)Sql Upgrade errors (Invalid column name: component_uuid)

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 10.1 => 10.3
  • how is SonarQube deployed: Docker
  • what are you trying to achieve? : migrate from 10.1 => 10.3
  • what have you tried so far to achieve this: change version of docker container
    Every time I have attempted to upgrade past version 10.1 I get a failed step and the only resolution is to restore the database…

Error Log:

2023-11-27T15:53:18.570027440Z 2023.11.27 15:53:18 ERROR web[][DbMigrations] Executed DB migrations: failure | time=9390ms
2023.11.27 15:53:18 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=9431ms
2023.11.27 15:53:18 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
2023-11-27T15:53:18.580271185Z org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #103006 'Populate 'creation_method' column in 'projects' table' failed
2023-11-27T15:53:18.580278785Z 	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
2023-11-27T15:53:18.580360186Z 	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
2023-11-27T15:53:18.580417087Z 	at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
2023-11-27T15:53:18.580424987Z 	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
2023-11-27T15:53:18.580469788Z 	at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:54)
2023-11-27T15:53:18.580485888Z 	at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
2023-11-27T15:53:18.580492388Z 	at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
2023-11-27T15:53:18.580503288Z 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
2023-11-27T15:53:18.580508588Z 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
2023-11-27T15:53:18.580543489Z 	at java.base/java.lang.Thread.run(Unknown Source)
2023-11-27T15:53:18.580557489Z Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'component_uuid'.
2023-11-27T15:53:18.580562789Z 	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1695)
2023-11-27T15:53:18.581011695Z 	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:648)
2023-11-27T15:53:18.581018495Z 	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:567)
2023-11-27T15:53:18.581024195Z 	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675)
2023-11-27T15:53:18.581030595Z 	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4137)
2023-11-27T15:53:18.581048796Z 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:272)
2023-11-27T15:53:18.581054896Z 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:246)
2023-11-27T15:53:18.581059596Z 	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:544)
2023-11-27T15:53:18.581065196Z 	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
2023-11-27T15:53:18.581070296Z 	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
2023-11-27T15:53:18.581075596Z 	at org.sonar.server.platform.db.migration.step.UpsertImpl.execute(UpsertImpl.java:66)
	at org.sonar.server.platform.db.migration.version.v103.PopulateCreationMethodColumnInProjectsTable.execute(PopulateCreationMethodColumnInProjectsTable.java:39)
2023-11-27T15:53:18.581093396Z 	at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:44)
2023-11-27T15:53:18.581099396Z 	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
2023-11-27T15:53:18.581104997Z 	... 9 common frames omitted

That’s an odd one. :thinking: I don’t see component_uuid referenced in the database migration.

I’ll flag this for attention.

We can close this… One of my guys put a trigger on a table we didnt know about… Once I removed that trigger the migration went smoothly.

1 Like