I’m very new to SonarQube and want to trial it out by setting up the server on Azure VM. I’ve followed the steps outlined in this article:
However, when I get to step 6 and attempt to start the service I get a message returned stating “The service name is invalid” - is there anything else I should do, or could someone advise on an other guides to getting this setup
Hello @alcoalex
Please make sure to follow our official documentation to install SonarQube.
If you still face issue following that please let us know.
Alex.
I’ve started fresh using the documentation - I’m now getting this error when I run the StartSonar.bat script on my server.
Waiting for Elasticsearch to be up and running Startup failed: Timed out waiting for signal from JVM. JVM did not exit on request, terminated JVM Restarts disabled. Shutting down.
@alcoalex
I already faced this when I tried to start SonarQube too soon after the boot of the Windows machine.
You may wait a few minutes after the server boot before trying to start SonarQube.
Can you try that and let me know ?
Alex.
@Alexandre_Frigout thanks for your reply. I’ve tried waiting and the error persisted.
I’ve now changed the sonar.path.data and sonar.path.temp values and now get the following error logged on the sonar log:
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.*
2020.11.18 12:59:25 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\DataTemp 2020.11.18 12:59:25 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:50398 2020.11.18 12:59:25 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [C:\SonarQube\sonarqube-8.5.1.38104\elasticsearch]: C:\Program Files\Java\jdk-11.0.9\bin\java -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=C:\DataTemp -XX:ErrorFile=…/logs/es_hs_err_pid%p.log -Des.enforce.bootstrap.checks=true -Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\SonarQube\sonarqube-8.5.1.38104\elasticsearch -Des.path.conf=C:\DataTemp\conf\es -cp lib/ org.elasticsearch.bootstrap.Elasticsearch* 2020.11.18 12:59:25 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running 2020.11.18 12:59:31 INFO app[][o.e.p.PluginsService] no modules loaded 2020.11.18 12:59:31 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 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.11.18 12:59:37 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1 2020.11.18 12:59:37 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped 2020.11.18 12:59:37 INFO app[][o.e.c.t.TransportClientNodesService] failed to get node info for {#transport#-1}{vZBDZlxsRQ2LEby3xN7vCw}{127.0.0.1}{127.0.0.1:50398}, 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:220)*
at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:285)* Caused by: java.lang.InterruptedException: null
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1040)*
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)*
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* 2020.11.18 12:59:37 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped <-- Wrapper Stopped
@alcoalex it seems that elastic search startup failed, the log you are showing is most probably the sonar.log entry. Please share the es.log content so we can have a deeper look into your issue.
Thanks @Alexandre_Frigout below is the log from ant attempt I tried earlier this morning:
2020.11.20 10:52:57 ERROR es[o.e.b.Bootstrap] Exception
java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Data\es6]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:300) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.8.4.jar:6.8.4]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) [elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.8.4.jar:6.8.4]
2020.11.20 10:52:57 WARN es[o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Data\es6]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.4.jar:6.8.4]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.4.jar:6.8.4]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Data\es6]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:300) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.4.jar:6.8.4]
… 6 more
@alcoalex, the below message indicates that either you have a permission issue on the C:\Data\es6 folder of several ES nodes are trying to write into it.
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Data\es6]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
Here I would recommend deleting the content of the C:\Data\es6 folder and check the permissions of it and then retry starting SonarQube.
Let me know the outcome.
Alex.