Upgrade from 26.2 to 26.3 fails w/ still "...on 25.12..." (?)

Summary:

  • which versions are you using: 26.2 Community Edition, PostgreSQL 18
  • how is SonarQube deployed: docker
  • what are you trying to achieve: upgrade from 25.9 → 25.12 → 26.2 → 26.3 to close the gap
  • what have you tried so far to achieve this: followed to proposed upgrade path

However, as 26.1 was incompatible w/ PostgreSQL 18, I upgraded from 25.9 → 25.12 → 26.2; this is the currently running container (works fine so far?). However, upgrading to 26.3 does not work as, apparently, I am still running 25.12 (?) [which is not the case]:

`...web[o.s.s.p.LogServerVersion] SonarQube Server / 26.2.0.119303 / 07c336764c9a74669df2512bc7ca53e28173c0ac...`

And here is a log entry if starting a 26.3 instance:

`...web[o.s.s.p.LogServerVersion] SonarQube Server / 26.3.0.120487 / 358ce654b5db4f1b2459698408d9ef11738028b6...`

`Error creating bean with name ‘jdk.internal.loader.ClassLoaders$AppClassLoader@764c12b6-org.sonar.server.platform.DatabaseServerCompatibility’: The version of SonarQube you are trying to upgrad
e from is too old. Please upgrade to the 25.12 version first.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jdk.internal.loader.ClassLoaders$AppClassLoader@764c12b6-org.sonar.server.platform.DatabaseServerCompatibility’: The
version of SonarQube you are trying to upgrade from is too old. Please upgrade to the 25.12 version first.`

Hi,

When you did the update from 25.9 to 25.12, did you actually run the DB upgrade? Because the error message is telling you that the DB still says it’s an older version.

 
Ann

Hi Ann,

Thank you for getting back to me.

Normally, a newer version always requires a DB update (even from 25.9 to 25.12), right?
As the message indicates 25.12, I assume I did (had tried a few things, therefore not 100 % sure).

How can I initiate a migration, again? .../setup says that everything’s OK w.r.t. the DB.

Best
Peter

Hi Peter,

Yes, each new update requires a DB migration.

So http://mySonarQubeURL/setup says the DB is up to date. What does your page footer say in terms of version?

 
Thx,
Ann

Salut,

After restoring to the last known good sonarqube data store:

  • Community Build v26.2.0.119303 MQR Mode

[edited] sorry; replying by mail did not work…

Hi,

Okay, if your page footer says 26.2 pre-update, then I can only guess you’re getting a version error from 26.3 because it’s pointed at the wrong DB. Can you check your DB JDBC URL configuration?

 
HTH,
Ann

There’s only one DB active; it is the one I am using. I guess a table version entry is wrong, and just changing it should do it (?)

I have a sonar.properties that I reuse (ldap, DB connection) for all my sonarqube instances.

Hi,

Uhm… I wouldn’t. No one else has reported this, so I think it’s probably local to your situation.

 
Ann

This seems super-fishy, as my setup is pretty standard…

Maybe providing the docker logs for each of the two versions 26.2 and 26.3 would help?

So here is the solution (that indication of 25.12 was indeed a red herring):
after (some?) docker image updates, the sonar.properties file gets reverted to a default one, not having the correct settings for the DB connection. Then the container tries to use the default local H2 database; in my case this triggered the aforementioned message. If one is quick enough during the startup process of the container to copy and/or adapt the sonar.properties, then everything is OK, and the new SQ version is then active.

How can the H2 be adapted to at least get rid of the misleading error message?

Hi,

I’m still not sure what was going on on your side. The H2 DB should always initialize to the current version. I can only guess that the H2 DB was initialized to a previous version and never cleaned out. You could simply throw the data file away.

 
Ann

I hope I will remeber this procedure for the next update, and try your proposed fix. So I tag my solution above Solution; hope that’s OK.

Thank you for holding my hand. Appreciated.

1 Like