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. (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(
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(
	at org.elasticsearch.client.RestHighLevelClient.performRequest(
	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(
	at org.sonar.application.process.EsManagedProcess.checkStatus(
	at org.sonar.application.process.EsManagedProcess.checkOperational(
	at org.sonar.application.process.EsManagedProcess.isOperational(
	at org.sonar.application.process.ManagedProcessHandler.refreshState(
	at org.sonar.application.process.ManagedProcessHandler$
Caused by: java.lang.InterruptedException: null
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(
	at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(
	at org.elasticsearch.common.util.concurrent.BaseFuture.get(
	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(
	... 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-\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>( ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.node.Node.<init>( ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.node.Node.<init>( ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>( ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Bootstrap.setup( ~[elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Bootstrap.init( [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.init( [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.execute( [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute( [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling( [elasticsearch-cli-7.17.6.jar:7.17.6]
	at org.elasticsearch.cli.Command.main( [elasticsearch-cli-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.main( [elasticsearch-7.17.6.jar:7.17.6]
	at org.elasticsearch.bootstrap.Elasticsearch.main( [elasticsearch-7.17.6.jar:7.17.6]

This typically means that ElasticSearch cannot acquire a lock for its data directory C:\Sonar\sonarqube-\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,, 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.