Sonarqube 10.3 won't start

Must-share information (formatted with Markdown):

  • which versions are you using: sonarqube 10.3
  • how is SonarQube deployed: zip
  • what are you trying to achieve: Start Sonar on Windows
  • what have you tried so far to achieve this:clean data/temp folders,computer restart

Hi,I’m trying to install SonarQube version 10.3.0.82913 on Windows (local computer) without success.
I have successful experience with version 9.9.3.79811 on the same computer.

There is a part from web.log

2023.11.22 14:55:10 INFO  web[][o.s.s.e.IndexCreator] Create index [issues]
2023.11.22 14:56:10 WARN  web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.server.es.IndexCreator': Initialization of bean failed; nested exception is org.sonar.server.es.ElasticsearchException: Fail to execute es requestES cluster health request
2023.11.22 14:56:10 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.server.es.IndexCreator': Initialization of bean failed; nested exception is org.sonar.server.es.ElasticsearchException: Fail to execute es requestES cluster health request
...
Caused by: org.sonar.server.es.ElasticsearchException: Fail to execute es requestES cluster health request
	at org.sonar.server.es.EsClient.execute(EsClient.java:336)
	at org.sonar.server.es.EsClient.clusterHealth(EsClient.java:210)
	at org.sonar.server.es.EsClient.waitForStatus(EsClient.java:215)
	at org.sonar.server.es.IndexCreator.createIndex(IndexCreator.java:147)
	at org.sonar.server.es.IndexCreator.lambda$start$1(IndexCreator.java:95)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at org.sonar.server.es.IndexCreator.start(IndexCreator.java:92)
	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
	... 17 common frames omitted
Caused by: org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=master_not_discovered_exception, reason=null]
	at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:178)
	at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2484)
	at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2461)
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2184)
	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.server.es.EsClient.lambda$clusterHealth$27(EsClient.java:210)
	at org.sonar.server.es.EsClient.execute(EsClient.java:334)
	... 35 common frames omitted
	Suppressed: org.elasticsearch.client.ResponseException: method [GET], host [http://127.0.0.1:9001], URI [/_cluster/health?master_timeout=30s&level=cluster&wait_for_events=languid&timeout=30s&wait_for_status=yellow], status line [HTTP/1.1 503 Service Unavailable]
{"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}
		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:347)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:313)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
		at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2699)
		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2171)
		... 40 common frames omitted

es.log

2023.11.22 14:55:10 WARN  es[][o.e.c.a.s.ShardStateAction] no master known for action [internal:cluster/shard/started] for shard entry [StartedShardEntry{shardId [[issues][2]], allocationId [5GLnUCYTS5-14-I5BszU4A], primary term [1], message [after new shard recovery]}]
2023.11.22 14:55:10 WARN  es[][o.e.c.s.MasterService] failing [shard-started StartedShardEntry{shardId [[issues][0]], allocationId [rKZ6hLqpRciwyT1y0o09WA], primary term [1], message [after new shard recovery]}[StartedShardUpdateTask{entry=StartedShardEntry{shardId [[issues][0]], allocationId [rKZ6hLqpRciwyT1y0o09WA], primary term [1], message [after new shard recovery]}, listener=org.elasticsearch.action.ActionListenerImplementations$MappedActionListener/ChannelActionListener{TaskTransportChannel{task=187}{DirectResponseChannel{req=85}{internal:cluster/shard/started}}}/org.elasticsearch.cluster.action.shard.ShardStateAction$ShardStartedTransportHandler$$Lambda$4303/0x000002a5a9a22d68@4544063d}]]: failed to commit cluster state version [32]
org.elasticsearch.cluster.coordination.FailedToCommitClusterStateException: publication of cluster state version [32] in term [1] failed [committed=false]
	at org.elasticsearch.cluster.coordination.Coordinator$CoordinatorPublication$4.onFailure(Coordinator.java:2042) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.action.support.SubscribableListener$FailureResult.complete(SubscribableListener.java:322) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.tryComplete(SubscribableListener.java:234) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.addListener(SubscribableListener.java:133) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.Coordinator$CoordinatorPublication.onCompletion(Coordinator.java:1948) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.Publication.onPossibleCompletion(Publication.java:113) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.Publication.onPossibleCommitFailure(Publication.java:164) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.Publication$PublicationTarget$PublishResponseHandler.onFailure(Publication.java:389) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.Coordinator$8.onFailure(Coordinator.java:1643) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:124) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.onFailure(ThreadContext.java:966) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:28) ~[elasticsearch-8.11.0.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.IllegalStateException: Failed to close the XContentBuilder
	at org.elasticsearch.xcontent.XContentBuilder.close(XContentBuilder.java:1261) ~[elasticsearch-x-content-8.11.0.jar:?]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.writePages(PersistedClusterStateService.java:1176) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.addIndexMetadataDocuments(PersistedClusterStateService.java:1140) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.updateMetadata(PersistedClusterStateService.java:1080) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.writeIncrementalStateAndCommit(PersistedClusterStateService.java:975) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.gateway.GatewayMetaState$LucenePersistedState.writeClusterStateToDisk(GatewayMetaState.java:600) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.gateway.GatewayMetaState$LucenePersistedState.setLastAcceptedState(GatewayMetaState.java:583) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.CoordinationState.handlePublishRequest(CoordinationState.java:392) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.Coordinator.handlePublishRequest(Coordinator.java:474) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.PublicationTransportHandler$PublicationContext$1.get(PublicationTransportHandler.java:408) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.cluster.coordination.PublicationTransportHandler$PublicationContext$1.get(PublicationTransportHandler.java:397) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:51) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:48) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:73) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) ~[elasticsearch-8.11.0.jar:?]
	... 3 more
Caused by: java.nio.file.AccessDeniedException: C:\Tools\SonarQubeDevelopEdition\sonarqube-10.3.0.82913\data\es8\_state\_w_Lucene90FieldsIndex-doc_ids_1s.tmp

It is caused by the mssql dll. They didn’t update de conf/sonar.properties version:

# https://github.com/microsoft/mssql-jdbc/releases/download/v12.2.0/mssql-jdbc_auth.zip
# and 'mssql-jdbc_auth-12.2.0.x64.dll' to your path.

It should say version 12.4.1. You will find the error in the web.log.

2 Likes

Update the mssql driver to version 12.4.1

Hello,
If you are using integrated Security with Windows for SonarQube 10.3, you indeed need to provide mssql-jdbc_auth-12.4.1.x64.dll as stated in the documentation.

This is indeed the case, the version mentioned there is incorrect and should be the one in the online documentation.
@ZnannaR Can you tell us if this solved your problem or if you need further help?

1 Like

Hi, thanks for the reply. The problem exists even if I run the server with an embedded database.

From what I see in the logs, it looks like ElasticSearch can’t start because it can’t access these files.
Usually, things that are not in your account folders have access restrictions, could you try to try to install SonarQube in your account folders?

Hello Steve!
Unfortunately this did not solve the problem:
Caused by: org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=access_denied_exception, reason=C:\Users\zhannar\sonarqube-10.3.0.82913\data\es8\indices\QPgA7BIATfmWZ1UIHmGebw\0\index\_7_Lucene90FieldsIndex-doc_ids_e.tmp]

I was hopping moving to your folders would solve the problem directly, but it looks like you still have a permission issue.
To be thorough, can you validate that you are starting SonarQube with your account (since it is in your folders) and that every folder in C:\Users\zhannar\sonarqube-10.3.0.82913, and especially C:\Users\zhannar\sonarqube-10.3.0.82913\data\es8\indices\QPgA7BIATfmWZ1UIHmGebw\0\index\_7_Lucene90FieldsIndex-doc_ids_e.tmp is indeed accessible in read/write to you?
Typically you could still have the issue if you start SonarQube as a service with a different user than the one that owns the folder it is installed, or if you have copied your installation from C:\Tools to your folders but kept the original permissions.

If it doesn’t work, I would recommend resetting the installation locally from the zip, in your account folders, with your users (you can use the embedded H2 database as a first step) and validate that it works without problem before continuing the installation.

Good morning,
Cause found: FortiClient is blocking java.exe (OpenJDK platform binary).
But! When I start version 9, I also get a blocking message, but this does not prevent the server from starting, although every time before that I have to delete files from the folders data and temp(by the way, this is a separate question why this needs to be done when restarting)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.