SonarQube 7.9 Unable to Start: Java Error Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch

Hi,

OS: CentOS 6.6 64-Bit
Java: OpenJDK 11
SonarQube: Version 7.9.2
User: sonar

As the user “sonar”, I try to start SonarQube and I get this error message in the log.

Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
java.lang.IllegalStateException: Future got interrupted

I’m pretty sure this is an easy fix related to the wrong version of Java or the path to Java but I can’t seem to find out what I am doing wrong. Would anyone happen to know what the issue is?

Does anyone have any idea on what the error could be?

JAVA_HOME is set. The user sonar starts the SonarQube and Elastic Search process.

Hi,

Welcome to the community!

It’s not clear to me whether or not your SQ instance is starting up despite this error. If not, could you provide the full stacktrace from the log and a few lines before it starts?

 
Ann

I just tried starting from scratch again:

OS: RedHat 7.7 (Fresh, minimal install)
Java: OpenJDK 11 (yum install java-11)
SonarQube: Version 7.9.2
User: sonar

I unzipped the file and I am trying to do the 2 minute install as per these instructions.
https://docs.sonarqube.org/7.9/setup/get-started-2-minutes/

SonarQube is not even starting. The only error log that is generated is sonar.log and the error is:
Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch

Hi, please provide the full logs as files. Could you please as well compute a md5 hash on the zip you downloaded ? you should get 600f9174417514d2040630a4ef472124

–> Wrapper Started as Daemon
Launching a JVM…
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.

2020.01.10 14:21:58 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /home/sonar/Downloads/sonarqube-7.9.2/temp
2020.01.10 14:21:58 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.01.10 14:21:58 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/home/sonar/Downloads/sonarqube-7.9.2/elasticsearch]: /home/sonar/Downloads/sonarqube-7.9.2/elasticsearch/bin/elasticsearch
2020.01.10 14:21:58 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Java HotSpot™ 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.01.10 14:21:58 INFO app[o.e.p.PluginsService] no modules loaded
2020.01.10 14:21:58 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
2020.01.10 14:21:58 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.01.10 14:21:58 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2020.01.10 14:21:58 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
2020.01.10 14:21:59 INFO app[o.e.c.t.TransportClientNodesService] failed to get node info for {#transport#-1}{AWCQ6U8ES-a_1s-IeiFM-A}{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.(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

The only log file generated is sonar.log. It doesn’t even get to the part where it generates the es.log or web.log or ce.log

Ok. I figured it out. The MD5 for the SonarQube zip file that I downloaded did not match. I downloaded SonarQube again and now it works.