Problem install Sonarqube 9.8 in Windows Server 2012

We want to install Sonarqube 9.8 Enterprise On-Premise, we had Sonarqube 7.9.4 and we decide to upgrade the version.

We are using Sonarqube 9.8 Enterprise On-Premise, we have Windows Server 2012 R2, and we installed Java 11. Also, install Java 17, and we increase the capacity of the server to 8 Cores and 16GB RAM.

But, when we execute StartSonar.bat, The server was getting slowness, and, then we watched the error: org.elasticsearch.ElasticsearchException: java.lang.InterruptedException.

Attach $SQ_HOME/logs.
logs_Sonarqube9.8.zip (32.0 KB)

Hi @edgar2704 ,

Thanks for the logs. Here’s what I see from that error you are referencing:

2022.12.28 15:42:31 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2022.12.28 15:44:23 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2022.12.28 15:44:23 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2022.12.28 15:44:23 ERROR app[][o.s.a.p.EsManagedProcess] Failed to check status
org.elasticsearch.ElasticsearchException: java.lang.InterruptedException
	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2695)
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2171)
	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:2137)
	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:2105)
	at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:151)
	at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:64)
	at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:92)
	at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:84)
	at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:62)
	at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:223)
	at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:288)
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:243)
	at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:75)
	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2692)
	... 10 common frames omitted

which refers to an error in your es.log:

2022.12.28 15:44:17 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Sonar\sonarqube-9.8.0.63668\data\es7]] 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.<init>(NodeEnvironment.java:328) ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.node.Node.<init>(Node.java:429) ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.node.Node.<init>(Node.java:309) ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:234) ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169) [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160) [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) [elasticsearch-cli-7.17.6.jar:7.17.6]
	at org.elasticsearch.cli.Command.main(Command.java:77) [elasticsearch-cli-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125) [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) [elasticsearch-7.17.6.jar:7.17.6]

This typically means that ElasticSearch cannot acquire a lock for its data directory C:\Sonar\sonarqube-9.8.0.63668\data\es7. This can be caused by a few circumstances, such as:

  • There is another SonarQube instance already running that is holding this lock
  • The location is not writable by SonarQube
  • A SonarQube instance crashed or didn’t terminate correctly, and as a result, it could not remove the lock.
  • Corrupted ES indexes and an ES reindex is necessary (i.e. delete $SQ_HOME/data/es7 folder and restart SonarQube)

First, please ensure you have sufficient memory for your Elasticsearch JVM process (specifically, sonar.search.javaOpts, see SonarQube Memory Tuning Guidelines) and then perform an ES reindex (as explained in Troubleshooting). You should verify you have sufficient hardware based on our Hardware recommendations.

If you still have issues after that, please explain how SonarQube is deployed. Do you run multiple SonarQube instances or create backup instances or recovery instances that are running somewhere else connected to your jdbc:sqlserver://localhost;databaseName=SONARQUBE database? Are you trying to set up multiple replicas?

Hi Joe,
We made changes on the server, where we configured the files with the path to the database, but today we are having this other error when running StartSonar.bat

Caused by: org.sonar.api.utils.MessageException: Current version is too old. Please upgrade to Long Term Support version firstly.

How can I correct the error?

You must upgrade based on the Before you upgrade guide here. You must upgrade from 7.9.4 to 8.9.10 to 9.8.0. You cannot jump from 7.9.4 to 9.8.0 directly.

Hi Joe,
But, In my case, I am changing the version, because we had the 7.9.4 developer version and now we will have the 9.8.0 enterprise version.

Then, How could I do it?

Hi @edgar2704,

As mentioned earlier, you cannot jump between 7.9.4 to 9.8.0 directly without going through 8.9.10 (see Before you upgrade).

You need to upgrade first to 8.9.10, then upgrade again to 9.8.0. It’s two upgrades, not one upgrade, that you need to do.