Unable to start sonarQube after upgrade

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    – Upgrading SonarQube 7.5 → 7.9.1
    – openjdk version “11.0.13” 2021-10-19
    OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
    – Postgres database 9.1

  • what are you trying to achieve
    I am upgrading sonarQube to 1.9.1.

  • what have you tried so far to achieve this
    I have unpacked the 7.9.1 and updated the wrapper.conf to point to OpenJDK11. Updated sonar.properties to point to database. When I run the sonar.sh start as a non root user. Service does not start and I am seeing below errors.

> Launching a JVM...
> Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
>   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
> 
> 2022.08.06 09:52:39 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /appl/sonar/sonarqube-7.9.6/temp
> 2022.08.06 09:52:39 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
> 2022.08.06 09:52:39 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/appl/sonar/sonarqube-7.9.6/elasticsearch]: /appl/sonar/sonarqube-7.9.6/elasticsearch/bin/elasticsearch
> 2022.08.06 09:52:39 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
> 2022.08.06 09:52:39 INFO  app[][o.e.p.PluginsService] no modules loaded
> 2022.08.06 09:52:39 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
> OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
> [0.001s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/appl/sonar/sonarqube-7.9.6/logs/sonarqube-search-gc.log instead.
> Unrecognized VM option 'UseGCLogFileRotation'
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit.
> 2022.08.06 09:52:39 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
> 2022.08.06 09:52:39 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
> 2022.08.06 09:52:39 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
> 2022.08.06 09:52:40 INFO  app[][o.e.c.t.TransportClientNodesService] failed to get node info for {#transport#-1}{3HSQxfzaQvK6gAKlpoyaLw}{127.0.0.1}{127.0.0.1:9001}, disconnecting...
> java.lang.IllegalStateException: Future got interrupted
>         at org.elasticsearch.common.util.concurrent.FutureUtils.get(FutureUtils.java:60)
>         at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:34)
>         at org.elasticsearch.transport.ConnectionManager.internalOpenConnection(ConnectionManager.java:209)
>         at org.elasticsearch.transport.ConnectionManager.openConnection(ConnectionManager.java:80)
>         at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:367)
>         at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:411)
>         at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:362)
>         at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(TransportClientNodesService.java:201)
>         at org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:342)
>         at org.sonar.application.es.EsConnectorImpl$MinimalTransportClient.<init>(EsConnectorImpl.java:108)
>         at org.sonar.application.es.EsConnectorImpl.buildTransportClient(EsConnectorImpl.java:89)
>         at org.sonar.application.es.EsConnectorImpl.getTransportClient(EsConnectorImpl.java:74)
>         at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:61)
>         at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:88)
>         at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:73)
>         at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:58)
>         at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:201)
>         at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:258)
> Caused by: java.lang.InterruptedException: null
>         at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343)
>         at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:251)
>         at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:94)
>         at org.elasticsearch.common.util.concurrent.FutureUtils.get(FutureUtils.java:57)
>         ... 17 common frames omitted
> <-- Wrapper Stopped

Here’s the issue:

Did you copy any other information from your warpper.conf or sonar.properties file, such as Java options?

Yes, I had these options enabled in my previous version that I did copy. I figured out that these are not supported by java 11.

sonar.ce.javaOpts=-Xmx4096m -Xms512m -verbose:gc -Xloggc:/appl/sonar/sonarqube-7.9.6/logs/sonarqube-ce-gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCCause -XX:+PrintGCApplicationStoppedTime -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/appl/sonar/heapdumps/ce


sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=~/heapdumps/sonar.web.hprof -Xloggc:/appl/sonar/sonarqube-7.9.6/logs/sonarqube-web-gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M

sonar.web.javaOpts=-Xmx512m -Xms128m -verbose:gc -Xloggc:/appl/sonar/sonarqube-7.9.6/logs/sonarqube-web-gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCCause -XX:+PrintGCApplicationStoppedTime -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/appl/sonar/heapdumps/web