Upgrade SONAR 6.7.7 to 7.9.4 LTS Problem step #2800 truncate

Hello everyone,

I’m facing a problem with an upgrade of my sonar instance 6.7.7 to 7.9.4 after 45 minutes of run.

My error is this one :

org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #2800 'Truncate environment variables and system properties from existing scanner reports' 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: [task_uuid=AWXYVjgIdDadhwUWnok3,context_data=[B@74a4fd03]
        at org.sonar.server.platform.db.migration.step.SelectImpl.newExceptionWithRowDetails(SelectImpl.java:90)
        at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:82)
        at org.sonar.server.platform.db.migration.step.MassUpdate.execute(MassUpdate.java:92)
        at org.sonar.server.platform.db.migration.version.v79.TruncateEnvAndSystemVarsFromScannerContext.execute(TruncateEnvAndSystemVarsFromScannerContext.java:44)
        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: org.postgresql.util.PSQLException: ERROR: missing chunk number 0 for toast value 151596 in pg_toast_16949
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
        at org.postgresql.core.v3.QueryExecutorImpl.fetch(QueryExecutorImpl.java:2372)
        at org.postgresql.jdbc.PgResultSet.next(PgResultSet.java:1856)
        at org.apache.commons.dbcp2.DelegatingResultSet.next(DelegatingResultSet.java:1160)
        at org.apache.commons.dbcp2.DelegatingResultSet.next(DelegatingResultSet.java:1160)
        at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:78)
        ... 13 common frames omitted

Have you got the manual query to make the update running fine ? I’m working with a postgresql-10.1.
Thank a lot for your help.

Hi, welcome to the community forum!

This is your error. That’s clearly on the database side. Your tables are corrupted. Might be a hardware issue.

You could try to repair the TOAST table, but it may be easier to just restore your database pre-upgrade on a new hardware, and re-run the SonarQube upgrade.