SonarQube not starting with Elasticsearch issue

Hi Team , When i try to start i am having issue with elastic search , can some one please help ??

+ eval '"/app/jboss/sonarqube/sonarqube-7.9.3/bin/linux-x86-64/./wrapper"' '"/app/jboss/sonarqube/sonarqube-7.9.3/bin/linux-x86-64/../../conf/wrapper.conf"' wrapper.syslog.ident=SonarQube 'wrapper.pidfile="/app/jboss/sonarqube/sonarqube-7.9.3/bin/linux-x86-64/./SonarQube.pid"'
++ /app/jboss/sonarqube/sonarqube-7.9.3/bin/linux-x86-64/./wrapper /app/jboss/sonarqube/sonarqube-7.9.3/bin/linux-x86-64/../../conf/wrapper.conf wrapper.syslog.ident=SonarQube wrapper.pidfile=/app/jboss/sonarqube/sonarqube-7.9.3/bin/linux-x86-64/./SonarQube.pid
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2022.02.03 10:26:39 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /app/jboss/sonarqube/sonarqube-7.9.3/temp
jvm 1    | 2022.02.03 10:26:39 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:29001
jvm 1    | 2022.02.03 10:26:39 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/app/jboss/sonarqube/sonarqube-7.9.3/elasticsearch]: /app/jboss/sonarqube/sonarqube-7.9.3/elasticsearch/bin/elasticsearch
jvm 1    | 2022.02.03 10:26:39 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
jvm 1    | 2022.02.03 10:26:39 INFO  app[][o.e.p.PluginsService] no modules loaded
jvm 1    | 2022.02.03 10:26:39 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1    | Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/config/properties/PropertiesConfigurationFactory
jvm 1    |      at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
jvm 1    | Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory
jvm 1    |      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
jvm 1    |      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
jvm 1    |      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
jvm 1    |      ... 1 more
jvm 1    | 2022.02.03 10:26:40 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
jvm 1    | 2022.02.03 10:26:40 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
jvm 1    | 2022.02.03 10:26:40 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
jvm 1    | 2022.02.03 10:26:41 INFO  app[][o.e.c.t.TransportClientNodesService] failed to get node info for {#transport#-1}{BWz4V7SbSW2RU-wlFPTxEg}{127.0.0.1}{127.0.0.1:29001}, disconnecting...
jvm 1    | java.lang.IllegalStateException: Future got interrupted
jvm 1    |      at org.elasticsearch.common.util.concurrent.FutureUtils.get(FutureUtils.java:60)
jvm 1    |      at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:34)
jvm 1    |      at org.elasticsearch.transport.ConnectionManager.internalOpenConnection(ConnectionManager.java:209)
jvm 1    |      at org.elasticsearch.transport.ConnectionManager.openConnection(ConnectionManager.java:80)
jvm 1    |      at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:367)
jvm 1    |      at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:411)
jvm 1    |      at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:362)
jvm 1    |      at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(TransportClientNodesService.java:201)
jvm 1    |      at org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:342)
jvm 1    |      at org.sonar.application.es.EsConnectorImpl$MinimalTransportClient.<init>(EsConnectorImpl.java:108)
jvm 1    |      at org.sonar.application.es.EsConnectorImpl.buildTransportClient(EsConnectorImpl.java:89)
jvm 1    |      at org.sonar.application.es.EsConnectorImpl.getTransportClient(EsConnectorImpl.java:74)
jvm 1    |      at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:61)
jvm 1    |      at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:88)
jvm 1    |      at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:73)
jvm 1    |      at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:58)
jvm 1    |      at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:201)
jvm 1    |      at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:258)
jvm 1    | Caused by: java.lang.InterruptedException: null
jvm 1    |      at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343)
jvm 1    |      at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:251)
jvm 1    |      at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:94)
jvm 1    |      at org.elasticsearch.common.util.concurrent.FutureUtils.get(FutureUtils.java:57)
jvm 1    |      ... 17 common frames omitted
wrapper  | <-- Wrapper Stopped

This is the error from server.log and also the same error i get when i run the sh sonar.sh console .

when i try to start elastic search i get 

+ exec /usr/lib/jvm/java-11/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true '-Djava.io.tmpdir=${ES_TMPDIR}' -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs/hs_err_pid%p.log 8:-XX:+PrintGCDetails 8:-XX:+PrintGCDateStamps 8:-XX:+PrintTenuringDistribution 8:-XX:+PrintGCApplicationStoppedTime 8:-Xloggc:logs/gc.log 8:-XX:+UseGCLogFileRotation 8:-XX:NumberOfGCLogFiles=32 8:-XX:GCLogFileSize=64m '9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m' 9-:-Djava.locale.providers=COMPAT 10-:-XX:UseAVX=2 -Des.path.home=/app/jboss/sonarqube/sonarqube-7.9.3/elasticsearch -Des.path.conf=/app/jboss/sonarqube/sonarqube-7.9.3/elasticsearch/config -Des.distribution.flavor=default -Des.distribution.type=tar -cp '/app/jboss/sonarqube/sonarqube-7.9.3/elasticsearch/lib/*' org.elasticsearch.bootstrap.Elasticsearch
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Error: Could not find or load main class 8:-XX:+PrintGCDetails
Caused by: java.lang.ClassNotFoundException: 8:-XX:+PrintGCDetails

My java version is

java -version
openjdk version “11.0.14” 2022-01-18 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.14+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.14+9-LTS, mixed mode, sharing)

Any help much appreciated

Hey there.

My guess is that some system administrator (or an automated tool) went and wiped Log4J from your server – which has the effect of not letting Elasticsearch (and therefore SonarQube) start.

We’ve confirmed that the minimum supported version of SonarQube (v8.9 LTS) is not vulnerable to the infamous Log4Shell vulnerability (SonarQube, SonarCloud, and the Log4J vulnerability).

  • You could try reinstalling your existing version of SonarQube
  • Immediately work on an upgrade to the minimum supported version of SonarQube, v8.9 LTS, which also includes a newer version of Elasticsearch (and the underlying Log4J) less likely to trigger cleanup.
1 Like

Thanks Colin , can i directly go from 7.9.3 to v8.9 LTS ?? any document i can follow ??

Yes, you can upgrade directly to v8.9 LTS.

I already linked to the upgrade documentation :slight_smile:

Thanks Colin , will check that