Moving from SQ 7.8 to SQ 7.9 LTS

We are attempting to upgrade from Sonarqube version 7.8 to 7.9. We are currently running Sonarqube with mysql as well as java 8. This means (from what we can tell) to complete this upgrade to Sonarqube 7.9 we will need to complete a database migration, a java upgrade, and a version upgrade for Sonarqube. We have figured out how to complete the database migration to postgres just fine. However, We will to go ahead and upgrade from Java 8 to Java 11 so we can prepare for the version upgrade. Unfortunately, after going into the wrapper.conf and changing the binary path to point at java 11 we are unable to bring Sonarqube back up with this new version of Java. We are seeing elastic search exist with a code of 143 in the sonar.log and we are seeing an ldap connection test failed error in the web.log. We have not changed anything in the configuration file between using java 8 and java 11. We are looking for some guidance or advice on getting this completed.

NOTE: We are running this on RHEL 7.

Hey there.

Are you trying to run SonarQube v7.8 on Java 11, or SonarQube v7.9? Please take note that SonarQube v7.9 LTS was the first version of SonarQube to officially support Java 11 as a runtime.

We are attempting to run 7.8 with Java 11 because according to the documentation Java 11 is supposedly supported. Prerequisites and Overview | SonarQube Docs. If we follow what you are saying, is the suggested path forward for a version upgrade to do a database migration first and then upgrade the java and sonarqube version at the same time?

Ah wow, my memory really failed me there. Sorry about that, you’re right.

What are the full errors you’re getting in your log files? (ce.log, es.log, web.log, sonar.log… whatever you are looking at in your logs directory)

Sonar.log:

2021.04.27 16:43:49 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2021.04.27 16:43:49 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/hd/dt/var/sonarqube-7.8/elasticsearch]: /opt/hd/dt/var/sonarqube-7.8/elasticsearch/bin/elasticsearch
2021.04.27 16:43:49 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2021.04.27 16:43:50 INFO  app[][o.e.p.PluginsService] no modules loaded
2021.04.27 16:43:50 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2021.04.27 16:43:59 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2021.04.27 16:43:59 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/hd/dt/var/sonarqube-7.8]: /usr/lib/jvm/java-11-openjdk-11.0.10.0.9-1.el7_9.x86_64/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/hd/dt/var/sonarqube-7.8/temp --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Dhttp.proxyHost=<We have a proxy server here> -Dhttp.proxyPort=7070 -Dhttp.nonProxyHosts=localhost|127.*|[::1] -Dhttps.proxyHost=<We have an actual proxy here> -Dhttps.proxyPort=7070 -cp ./lib/common/*:/opt/hd/dt/var/sonarqube-7.8/lib/jdbc/mysql/mysql-connector-java-5.1.46.jar org.sonar.server.app.WebServer /opt/hd/dt/var/sonarqube-7.8/temp/sq-process13515517914673474380properties
2021.04.27 16:44:09 INFO  app[][o.s.a.SchedulerImpl] Process[web] is stopped
2021.04.27 16:44:09 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143
2021.04.27 16:44:09 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2021.04.27 16:44:09 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped

web.log error:

org.sonar.api.utils.SonarException: Security realm fails to start: Unable to open LDAP connection
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:93)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:561)
at org.sonar.server.platform.Platform.start(Platform.java:211)
at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185)
at org.sonar.server.platform.Platform.access$500(Platform.java:46)
at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
at org.sonar.server.platform.Platform$1.doRun(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.sonar.plugins.ldap.LdapException: Unable to open LDAP connection
at org.sonar.plugins.ldap.LdapContextFactory.testConnection(LdapContextFactory.java:211)
at org.sonar.plugins.ldap.LdapRealm.init(LdapRealm.java:63)
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:87)
… 19 common frames omitted
Caused by: javax.naming.CommunicationException: simple bind failed:
at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:219)
at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2895)
at java.naming/com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:348)
at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:262)
at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:226)
at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:280)
at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:185)
at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:115)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:719)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.ldap.InitialLdapContext.(InitialLdapContext.java:154)
at org.sonar.plugins.ldap.LdapContextFactory.createInitialDirContext(LdapContextFactory.java:134)
at org.sonar.plugins.ldap.LdapContextFactory.createBindContext(LdapContextFactory.java:96)
at org.sonar.plugins.ldap.LdapContextFactory.testConnection(LdapContextFactory.java:207)
… 21 common frames omitted
Caused by: java.net.SocketException: Connection or outbound has closed
at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1195)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:405)
at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:378)
at java.naming/com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:359)
at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:214)
… 35 common frames omitted
2021.04.27 16:44:08 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process
2021.04.27 16:44:09 WARN web[o.s.p.ProcessEntryPoint$HardStopperThread] Can not stop in 1000ms
2021.04.27 16:44:09 WARN web[o.s.s.a.EmbeddedTomcat] Failed to stop web server
org.apache.catalina.LifecycleException: Failed to stop component [StandardServer[-1]]
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:238)
at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:437)
at org.sonar.server.app.EmbeddedTomcat.terminate(EmbeddedTomcat.java:104)
at org.sonar.server.app.WebServer.hardStop(WebServer.java:83)
at org.sonar.process.ProcessEntryPoint$HardStopperThread.lambda$new$0(ProcessEntryPoint.java:219)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardService[Tomcat]]
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:238)
at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:814)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
… 9 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Tomcat]]
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:238)
at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:486)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
… 11 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during stop
at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1008)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
… 13 common frames omitted

These two logs contain the errors we are seeing. When attempting to use Java 11 we change the path in the wrapper.conf to point at our java 11 binary and have not touched anything in our configuration file other than the two outdated Garbage collection calls in the java options.

Hm. :thinking: Are you using ldap or ldaps, and which port are you specifying?

ldap as that is what is in our prior configuration. As well which ports are you referring to? proxy port, http port, https port, or some other port?