Update from 10.8 to 2025.2 errors

  • using docker image sonarqube:developer, which should be 2025.2
  • deployed using docker compose and postgres 14
  • Running just fine until this morning, i just did a docker compose pull and docker compose up -d
  • i checked the user permissions, it has all possible permissions on the database

starting the container, i get this:

sonarqube-1  | 2025.05.20 08:19:43 INFO  web[][o.s.s.p.d.m.h.MigrationHistoryTableImpl] Creating table schema_migrations
sonarqube-1  | 2025.05.20 08:19:43 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@2320fa6f-org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl': Failed to create table schema_migrations
sonarqube-1  | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@2320fa6f-org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl': Failed to create table schema_migrations
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:608)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:307)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.instantiateSingleton(DefaultListableBeanFactory.java:1122)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton(DefaultListableBeanFactory.java:1093)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1030)
sonarqube-1  | 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:987)
sonarqube-1  | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)
sonarqube-1  | 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
sonarqube-1  | 	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
sonarqube-1  | 	at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:217)
sonarqube-1  | 	at org.sonar.server.platform.PlatformImpl.startLevel2Container(PlatformImpl.java:189)
sonarqube-1  | 	at org.sonar.server.platform.PlatformImpl.init(PlatformImpl.java:81)
sonarqube-1  | 	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:45)
sonarqube-1  | 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4008)
sonarqube-1  | 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4436)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
sonarqube-1  | 	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
sonarqube-1  | 	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
sonarqube-1  | 	at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:749)
sonarqube-1  | 	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
sonarqube-1  | 	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
sonarqube-1  | 	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
sonarqube-1  | 	at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:749)
sonarqube-1  | 	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:203)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:415)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:870)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:72)
sonarqube-1  | 	at org.sonar.server.app.WebServer.start(WebServer.java:54)
sonarqube-1  | 	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
sonarqube-1  | 	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
sonarqube-1  | 	at org.sonar.server.app.WebServer.main(WebServer.java:102)
sonarqube-1  | Caused by: java.lang.IllegalStateException: Failed to create table schema_migrations
sonarqube-1  | 	at org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl.start(MigrationHistoryTableImpl.java:48)
sonarqube-1  | 	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:423)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601)
sonarqube-1  | 	... 45 common frames omitted
sonarqube-1  | Caused by: org.postgresql.util.PSQLException: ERROR: relation "schema_migrations" already exists
sonarqube-1  | 	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733)
sonarqube-1  | 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2420)
sonarqube-1  | 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
sonarqube-1  | 	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517)
sonarqube-1  | 	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434)
sonarqube-1  | 	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:356)
sonarqube-1  | 	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:341)
sonarqube-1  | 	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:317)
sonarqube-1  | 	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:312)
sonarqube-1  | 	at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
sonarqube-1  | 	at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
sonarqube-1  | 	at org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl.execute(MigrationHistoryTableImpl.java:71)
sonarqube-1  | 	at org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl.createTable(MigrationHistoryTableImpl.java:59)
sonarqube-1  | 	at org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl.start(MigrationHistoryTableImpl.java:45)
sonarqube-1  | 	... 49 common frames omitted

i tried removing the table, then it complains about the migration history table missing

sonarqube-1  | 2025.05.20 10:26:20 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@2320fa6f-org.sonar.server.platform.db.migration.history.MigrationHistoryImpl': Migration history table is missing
sonarqube-1  | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@2320fa6f-org.sonar.server.platform.db.migration.history.MigrationHistoryImpl': Migration history table is missing
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:608)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:307)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.instantiateSingleton(DefaultListableBeanFactory.java:1122)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton(DefaultListableBeanFactory.java:1093)
sonarqube-1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1030)
sonarqube-1  | 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:987)
sonarqube-1  | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)
sonarqube-1  | 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
sonarqube-1  | 	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
sonarqube-1  | 	at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:217)
sonarqube-1  | 	at org.sonar.server.platform.PlatformImpl.startLevel2Container(PlatformImpl.java:189)
sonarqube-1  | 	at org.sonar.server.platform.PlatformImpl.init(PlatformImpl.java:81)
sonarqube-1  | 	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:45)
sonarqube-1  | 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4008)
sonarqube-1  | 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4436)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
sonarqube-1  | 	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
sonarqube-1  | 	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
sonarqube-1  | 	at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:749)
sonarqube-1  | 	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
sonarqube-1  | 	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
sonarqube-1  | 	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
sonarqube-1  | 	at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
sonarqube-1  | 	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:749)
sonarqube-1  | 	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:203)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:415)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:870)
sonarqube-1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
sonarqube-1  | 	at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:72)
sonarqube-1  | 	at org.sonar.server.app.WebServer.start(WebServer.java:54)
sonarqube-1  | 	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
sonarqube-1  | 	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
sonarqube-1  | 	at org.sonar.server.app.WebServer.main(WebServer.java:102)
sonarqube-1  | Caused by: java.lang.IllegalStateException: Migration history table is missing
sonarqube-1  | 	at com.google.common.base.Preconditions.checkState(Preconditions.java:513)
sonarqube-1  | 	at org.sonar.server.platform.db.migration.history.MigrationHistoryImpl.start(MigrationHistoryImpl.java:54)
sonarqube-1  | 	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:423)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
sonarqube-1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601)
sonarqube-1  | 	... 45 common frames omitted

what could be the issue?

Hi,

Welcome to the community!

SonarQube is trying (and failing) to initiate its schema in the DB you’ve pointed it to. If this is an existing instance, something’s gone sideways with your DB or SonarQube’s connection to it.

 
HTH,
Ann

Right, that’s why I’m asking for help :slight_smile:
I checked and renewed permissions, everything’s proper. I dropped or emptied the migration table, but then I get the “migration history table missing” error…

Now, I did roll back, running 10.8 again, but I would really like to update. I’ll take it in smaller increments next time, not from 10.8 straight to 2025.2.

Hi,

Yeah… don’t do that.

How did you perform the rollback? Did you restore your DB backup? Because you would need to do that if your DB had been properly upgraded to 2025.2. Especially after you cleaned out the migrations table.

 
Ann

I mean, it was complaining about the table being there already. I was just testing. Of course, with backups before trying anything. I don’t go dropping production tables blindly :slight_smile:

Regarding the rollback, I have backups of both the database (postgres at aiven) and the vm running SQ, so it was easy to roll back both of them to a couple of hours before the update.

Meanwhile, I did try a new update, this time to 2025.1-developer, and that worked out just fine. And then I tried from 2025.1 to 2025.2, and I reached the same issue as in my original post. So there is something in .2 that does not agree with my environment…

Hi,

The error we started this with was

SonarQube doesn’t create foundational tables like schema_migrations during an upgrade. Again, the fact that you got that error signals that something went sideways when you configured the new version with the existing DB address/credentials.

 
Ann

the only change i did was to switch the image tag from 2025.1-developer to 2025.2-developer in the compose file, same process i’ve used with every other update in the past.

is there something specific that i have to do for this version in particular?

Hi,

There shouldn’t be anything specific.

 
Ann