Upgrade SQ from 9.9.4 to 10.4.1

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube): 9.6.1 → 9.9.4
  • how is SonarQube deployed: zip, Docker
  • what are you trying to achieve: upgrade to 10.4.1 from 9.9.4, previously upgraded from 9.6.1
  • what have you tried so far to achieve this: upgrade via docker

I have installed SQ version 9.6.1 developer on-prem from zip, with postgres10 server. On Docker I’m testing newer version.
Currently, I was able to do an upgrade to version 9.9.4 developer.

I wanted to test version 10.4.1, however, after executing /setup step, SQ terminates with an error:

2024.03.29 23:26:00 INFO  web[][o.s.s.q.b.BuiltInQProfileRepositoryImpl] Load quality profiles
2024.03.29 23:26:00 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@22295ec4-org.sonar.server.qualityprofile.builtin.BuiltInQProfileLoader': Initialization of bean failed; nested exception is java.lang.IllegalStateException: The following languages have no built-in quality profiles: kubernetescssscalajsppyjsdockerplsqljavawebflexxmljsontextvbnetcloudformationgrvyyamlswiftcppcgokotlinneutraltsqlsecretsrubycsphpterraformazureresourcemanagerabapobjcts
2024.03.29 23:26:00 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@22295ec4-org.sonar.server.qualityprofile.builtin.BuiltInQProfileLoader': Initialization of bean failed; nested exception is java.lang.IllegalStateException: The following languages have no built-in quality profiles: kubernetescssscalajsppyjsdockerplsqljavawebflexxmljsontextvbnetcloudformationgrvyyamlswiftcppcgokotlinneutraltsqlsecretsrubycsphpterraformazureresourcemanagerabapobjcts
	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:222)
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.access$001(PlatformLevelStartup.java:58)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:134)
	at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:46)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:131)
	at org.sonar.server.platform.PlatformImpl.executeStartupTasks(PlatformImpl.java:201)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:362)
	at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:116)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:346)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: The following languages have no built-in quality profiles: kubernetescssscalajsppyjsdockerplsqljavawebflexxmljsontextvbnetcloudformationgrvyyamlswiftcppcgokotlinneutraltsqlsecretsrubycsphpterraformazureresourcemanagerabapobjcts
	at com.google.common.base.Preconditions.checkState(Preconditions.java:601)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.ensureAllLanguagesHaveAtLeastOneBuiltInQP(BuiltInQProfileRepositoryImpl.java:109)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.initialize(BuiltInQProfileRepositoryImpl.java:91)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileLoader.start(BuiltInQProfileLoader.java:37)
	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
	... 19 common frames omitted
2024.03.29 23:26:00 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2024.03.29 23:26:00 INFO  web[][o.s.s.n.NotificationDaemon] Notification service stopped
2024.03.29 23:26:00 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown initiated...
2024.03.29 23:26:00 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown completed.
2024.03.29 23:26:00 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [OkHttp TaskRunner] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@17.0.10/java.lang.Object.wait(Native Method)\n java.base@17.0.10/java.lang.Object.wait(Unknown Source)\n app//okhttp3.internal.concurrent.TaskRunner$RealBackend.coordinatorWait(TaskRunner.kt:294)\n app//okhttp3.internal.concurrent.TaskRunner.awaitTaskToRun(TaskRunner.kt:218)\n app//okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:59)\n java.base@17.0.10/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n java.base@17.0.10/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n java.base@17.0.10/java.lang.Thread.run(Unknown Source)
2024.03.29 23:26:00 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Okio Watchdog] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@17.0.10/jdk.internal.misc.Unsafe.park(Native Method)\n java.base@17.0.10/java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)\n java.base@17.0.10/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)\n app//okio.AsyncTimeout$Companion.awaitTimeout$okio(AsyncTimeout.kt:320)\n app//okio.AsyncTimeout$Watchdog.run(AsyncTimeout.kt:186)
2024.03.29 23:26:01 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2024.03.29 23:26:01 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.03.29 23:26:01 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 143

What I do:

  • Before updating, I dump the db pg_dump -U sonar sonar | gzip > init.sql.gz and initialize the postrgres in the docker with it: - ./init.sql.gz:/docker-entrypoint-initdb.d/init.sql.gz
  • run via docker-compose, postgres12, pgadmin4, and SQ 10.4.1-developer

I’m also using own Dockerfile, becasue I need own root CAs, and Python sonar-tools, but it is not demanding.

What else can I do? Do I need the whole database? It takes up 3.6GB compressed.

Ps. vacuum, reindex, and analyze didn;t help

Hi,

Let’s back up. Does 9.9.4 start up and run as it should?

Can you retry this with a Sonar-provided/supported distro?

 
Thx,
Ann

Yes.

What do you mean? I’m using own Dockerfile because I need copy root CA. Our ldap using self-signed certficate. Also, somewhere in the database is sewn in the connection to the Bitbucket server, which also uses the self-signed certificate. Directly, I can use officail docker image but with mounted volumes: certificates and sonar properties.
Finally, I run Sonar on Centos7. I have to plan migrate to RH9, but in future, because there are a lot of VMs with Centos7 in my company :frowning:

Hi,

Yeah, I got that. But what happens if you don’t? Just point a standard distro at your DB & spin it up to see what happens.

 
Ann

1 Like