SonarQube upgrade failure from v7.0 to v7.9.4

I was trying to upgrade the SonarQube version from 7.0 to 7.9.4 (LTS), which is failed during the database migration. Here attached the log file.

web.txt (10.0 KB)

And also I have observed that SonarQube database having the tables with 2 different DB roles like db_owner and dbo.
(E.g.: db_owner.properties , dbo.user)

As per the logs, it is mentioned that the table already exists in SonarQube database. These table are belongs to db_owner role based tables. If I removed all the db_owner.tables from SonarQube database and trying to start the upgrade then upgrade is successful without any issues but SonarQube dashboard displays with empty data. is it performing fresh installation instead of upgrade?

Thanks in advance!

Hi,

Welcome to the community!

What I see is this:

org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1 'Create initial schema' failed

This has the word “migration” in it, but the step that failed is (emphasis added) “Create initial schema”. What that means is that when SonarQube connected to your database, it didn’t find anything to migrate. In fact, it didn’t find anything it recognized at all. So it set out to create its database schema like with a brand new install.

What you’ve mentioned about DB roles is interesting, but this is probably going to come back to your database connection. Are you sure you’re connecting to the right schema in the right database with the right permissions?

Uhm… Don’t do that. You should never touch SonarQube’s database manually unless it’s under the direction of a SonarSourcer.

 
Ann

Thank you for quick response.

Now I changed the default schema value from db_owner to dbo and tried to upgrade the Sonarqube 7.9.4 version by starting the windows service. But database upgrade is failed during the setup process.

Below is the error on URL …/setup:

Upgrade Failed
Database connection cannot be established. Please check database status and JDBC settings.

Here is the web.log:
web.log (8.6 KB)

Hi,

It looks like you already know what the problem is:

I’m sorry, but I can’t help you get connected to the database.

 
Ann