Getting Error while upgrading 4.5 to 5.6.7 LTS, DB Migration failing

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Upgrading from 4.5.7 LTS to 5.6.7 LTS on PostgreSQL 9.5, the Upgrade process fails with following error.
    2019.05.22 19:29:31 INFO web[DbMigration] == FeedIssueLongDates: migrated (1249.1310s) =================================
    2019.05.22 19:29:31 INFO web[DbMigration]
    2019.05.22 19:29:32 INFO web[DbMigration] == RenameIssueLongDates: migrating ===========================================
    2019.05.22 19:29:32 INFO web[DbMigration] – remove_index(“issues”, {:name=>“issues_updated_at”})
    2019.05.22 19:29:33 INFO web[DbMigration] -> 1.2000s
    2019.05.22 19:29:33 INFO web[DbMigration] -> 0 rows
    2019.05.22 19:29:33 INFO web[DbMigration] – columns(“issues”)
    2019.05.22 19:29:33 INFO web[DbMigration] -> 0.0260s
    2019.05.22 19:29:33 INFO web[DbMigration] – remove_column(“issues”, “created_at”)
    2019.05.22 19:29:33 INFO web[DbMigration] -> 0.0770s
    2019.05.22 19:29:33 INFO web[DbMigration] – columns(“issues”)
    2019.05.22 19:29:33 INFO web[o.s.s.d.m.PlatformDatabaseMigration] DB migration failed | time=2078062ms
    2019.05.22 19:29:33 ERROR web[o.s.s.d.m.PlatformDatabaseMigration] DB Migration or container restart failed. Process ended with an exception
    org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled:

No message available
2019.05.22 19:44:27 INFO ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer…

Any help ?

Hi,

Could you please check that there are no other errors ?
Because even if it’s written “DB Migration failed”, in very old version of SonarQube this error was reported at startup even when the issue is not from DB but from something else.

Regards,
Julien Lancelot

Thanks Julien for responding
There are no other errors we are seeing in the logs we did Vanilla Setup for 4.5 and tried upgrading to 5.6.7 LTS but it failed with the same error. The DB migration runs for 1+ hr and fails with the same error.

Then I’m sorry to say that it will be very hard to help you, as this is an old version of SonarQube…
I would like to propose you to get in touch with our Support team who may be able to help you.

We are running on Community Edition so I am not sure if support will entertain the issue and help us resolve. Is there anyway to port data from old version to new version? So we plan to install fresh server of higher or latest version and can port the data from old to make sure we have all the scanned reports and metadata in new system.

We did run sonar upgrade using log level to trace and found below

2019.05.27 18:57:10 INFO web[DbMigration] == RenameIssueLongDates: migrating ===========================================
2019.05.27 18:57:10 INFO web[DbMigration] – remove_index(“issues”, {:name=>“issues_updated_at”})
2019.05.27 18:57:12 TRACE web[sql] time=1376ms | sql=DROP INDEX issues_updated_at
2019.05.27 18:57:12 INFO web[DbMigration] -> 1.3780s
2019.05.27 18:57:12 INFO web[DbMigration] -> 0 rows
2019.05.27 18:57:12 INFO web[DbMigration] – columns(“issues”)
2019.05.27 18:57:12 INFO web[DbMigration] -> 0.1340s
2019.05.27 18:57:12 INFO web[DbMigration] – remove_column(“issues”, “created_at”)
2019.05.27 18:57:12 TRACE web[sql] time=133ms | sql=ALTER TABLE “issues” DROP “created_at”
2019.05.27 18:57:12 INFO web[DbMigration] -> 0.1360s
2019.05.27 18:57:12 INFO web[DbMigration] – columns(“issues”)
2019.05.27 18:57:12 TRACE web[sql] time=1ms | sql=select 1
2019.05.27 18:57:12 INFO web[o.s.s.d.m.PlatformDatabaseMigration] DB migration failed | time=2088815ms
2019.05.27 18:57:12 ERROR web[o.s.s.d.m.PlatformDatabaseMigration] DB Migration or container restart failed. Process ended with an exception
org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled:

No message available
2019.05.27 18:57:13 TRACE web[sql] time=0ms | sql=select version from schema_migrations