Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-12260

DB Migration #1945 "Delete file measures" fails on SQL Server when migrating from 6.7 LTS

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 7.9
    • Fix Version/s: 7.9.1
    • Component/s: Database
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      DB Migration #1945 "Delete file measures" fails on SQL Server with the following stacktrace:

      > 2019.06.29 23:56:43 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 #1945 'Delete file 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 java.base/java.lang.Iterable.forEach(Iterable.java:75)
      >     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=AWulqo2AB7tUEEzuuHqQ]
      >     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:92)
      >     at org.sonar.server.platform.db.migration.version.v70.DeleteFileMeasures.execute(DeleteFileMeasures.java:41)
      >     at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:45)
      >     at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
      >     ... 9 common frames omitted
      > Caused by: java.sql.BatchUpdateException: Incorrect syntax near 'pm'.
      >     at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2083)
      >     at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:223)
      >     at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:223)
      >     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:119)
      >     at org.sonar.server.platform.db.migration.step.MassUpdate.lambda$execute$0(MassUpdate.java:92)
      >     at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:78)
      >     ... 13 common frames omitted 

        Attachments

          Activity

            People

            • Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              sebastien.lesaint Sebastien Lesaint
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: