9.9.0 LTA database-move results in "Current version too old"?

I’ve been in the process of migrating our SQ (Community Edition) 8.9 LTA (on PostgreSQL 9.6) to 9.9 LTA (on PostgreSQL 15). We’re running the .zip deployment.

We successfully moved from PG9.6 to 12, and moved SQ to v 9.9.0 LTA, ran the in-app database-upgrade, everything works fine. Then we move the database content from the old database-server to a newer server running PG 15, point SQ at the new database-server, and now we get

2024.05.10 12:09:39 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.platform.DatabaseServerCompatibility': Initialization of bean failed; nested exception is Current version is too old. Please upgrade to Long Term Support version firstly.

To test if maybe SQ 9.9.0 had a PG JDBC driver that didn’t like PG 15, I unpacked SQ 9.9.5, transferred the config and started SQ. Still getting the same error. How can I get “Version too old” when it’s the latest version?

For the time being I’ve reverted back to the old database-server, with SQ 9.9.5. Ran the in-app database-upgrade, and everything is working, but I still need to migrate off of this database-server.

Hi,

Welcome to the community!

All you should need to do here is back up your current (SQ9.9.5) DB and restore it in the new server. Then update your SonarQube configs to point to the new DB.

 
HTH,
Ann

Thanks for the kind welcome.
We dumped the database from the old server (PG12) to the new server (PG15), and that’s when it failed. We’re thinking about doing an in-place upgrade to PG15 on the old server and then moving the data, just to try that.

Tried upgrading to PG15 on the old database server, works fine, dumped database, imported it to the new database server, and it fails again.

This is the entire output of one cycle from web.log which is the only log that spits out an error:

2024.05.14 12:50:35 INFO  web[][o.s.p.ProcessEntryPoint] Starting Web Server
2024.05.14 12:50:35 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.9.5.90363 / dfc7d8d716ea13cce42ab9d806d74568f3f4693f
2024.05.14 12:50:35 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://rin-db1516/apputv1ptst
2024.05.14 12:50:35 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Starting...
2024.05.14 12:50:36 INFO  web[][c.z.h.p.HikariPool] HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@4784013e
2024.05.14 12:50:36 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Start completed.
2024.05.14 12:50:36 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube/sonarqube-9.9.5.90363
2024.05.14 12:50:36 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2024.05.14 12:50:36 WARN  web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.platform.DatabaseServerCompatibility': Initialization of bean failed; nested exception is The version of SonarQube is too old. Please upgrade to the Long-Term Active version first.
2024.05.14 12:50:36 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.platform.DatabaseServerCompatibility': Initialization of bean failed; nested exception is The version of SonarQube is too old. Please upgrade to the Long-Term Active version first.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
	at org.sonar.server.platform.platformlevel.PlatformLevel2.start(PlatformLevel2.java:103)
	at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:196)
	at org.sonar.server.platform.PlatformImpl.startLevel2Container(PlatformImpl.java:169)
	at org.sonar.server.platform.PlatformImpl.init(PlatformImpl.java:77)
	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4462)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4914)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:794)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:248)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:921)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.startup.Tomcat.start(Tomcat.java:489)
	at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:72)
	at org.sonar.server.app.WebServer.start(WebServer.java:55)
	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
	at org.sonar.server.app.WebServer.main(WebServer.java:104)
Caused by: org.sonar.api.utils.MessageException: The version of SonarQube is too old. Please upgrade to the Long-Term Active version first.
2024.05.14 12:50:36 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown initiated...
2024.05.14 12:50:36 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown completed.
2024.05.14 12:50:36 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 7002
2024.05.14 12:50:36 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process

I’m really not understanding why we get this error…

If it’s relevant, we’re running SonarQube using Temurin OpenJDK 17.0.11+9.

Hi,

This is the message you get when you try to skip an LTA in the upgrade journey. E.G. if you were trying to upgrade from 8.7 directly to 9.9 without a waypoint at 8.9 in the middle.

Your DB should be at 9.9.0. (BTW, you should really be targeting the latest point release, which is currently 9.9.5.)

Even if it’s not at 9.9, it ought to be at 8.9 at the worst, and thus upgradable to 9.9 and not causing this message.

I can only think here that you’re accidentally restoring a too-old DB backup.

Maybe try pointing 8.9 at your restored/moved DB and see what happens?

 
Ann

P.S. Our spam filter isn’t very smart and sometimes logs/stacktraces confuse it. Your post-edit got caught up in that, which is why it seemed to disappear briefly.

Aha! Yeah, we were at 8.9 LTS before moving to 9.9.0 LTS, and then finally to 9.9.5 LTS.

I’ll try connecting to the new database server using the latest 8.9 LTS to see what happens.

1 Like

Thanks for the “are you dumping the correct database?” point. I fired up SQ 8.9 against the new database, and it crashes because of a UTF8-issue, but just before that it complains about the database being in need of an update. I’ve returned the issue to the database people to figure out what is being transferred to the new database server…

1 Like

It’s fixed!

There were two issues at play:

  1. The DBA had restored my database-schema to abc1xyz-prd instead of abcxyz1-prd, and failed to communicate this, or notice that I kept sending them a connection-string that didn’t match what they were doing.

  2. They had also managed to restore a non-UTF8 PostGIS-schema into the SonarQube schema, so SQ kept freaking out over the presence of non-UTF8 tables.

Conclusion: All is well, we’ve gotten rid of two CentOS 7 servers (app- and database-servers), and I now know to triple-check everything the DBAs do… :joy:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.