Can't start Sonarqube due to ElasticSearch

Tried to start Sonarqube on Windows, latest version (Commununity)

CMD opens and closes, with the following logs:

Sonar

2024.01.20 12:03:04 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp
2024.01.20 12:03:04 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:65285]
2024.01.20 12:03:04 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch]: C:\Program Files\Java\jdk-21\bin\java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch -Des.path.conf=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp\conf\es -Des.distribution.type=tar -cp C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch\lib\*;C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2024.01.20 12:03:04 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.01.20 12:15:06 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp
2024.01.20 12:15:06 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50592]
2024.01.20 12:15:06 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch]: C:\Program Files\Java\jdk-21\bin\java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch -Des.path.conf=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp\conf\es -Des.distribution.type=tar -cp C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch\lib\*;C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2024.01.20 12:15:06 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.01.20 12:15:10 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2024.01.20 12:15:10 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.01.20 12:15:10 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2024.01.20 12:15:10 ERROR app[][o.s.a.p.EsManagedProcess] Failed to check status
java.lang.RuntimeException: thread waiting for the response was interrupted
	at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:901)
	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:300)
	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)
	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:79)
	at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:92)
	at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:77)
	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.lang.Object.wait0(Native Method)
	at java.base/java.lang.Object.wait(Object.java:366)
	at java.base/java.lang.Object.wait(Object.java:339)
	at org.apache.http.concurrent.BasicFuture.get(BasicFuture.java:82)
	at org.apache.http.impl.nio.client.FutureWrapper.get(FutureWrapper.java:70)
	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:296)
	... 12 common frames omitted

Es.log:

2024.01.20 12:03:06 WARN  es[][o.a.l.i.v.VectorizationProvider] Java vector incubator module is not readable. For optimal vector performance, pass --add-modules jdk.incubator.vector to enable Vector API.
2024.01.20 12:03:07 INFO  es[][o.e.n.Node] version[8.11.0], pid[14220], build[tar/d9ec3fa628c7b0ba3d25692e277ba26814820b20/2023-11-04T10:04:57.184859352Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/21.0.2/21.0.2+13-LTS-58]
2024.01.20 12:03:07 INFO  es[][o.e.n.Node] JVM home [C:\Program Files\Java\jdk-21], using bundled JDK [false]
2024.01.20 12:03:07 INFO  es[][o.e.n.Node] JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -Djava.security.manager=allow, -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, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=org.elasticsearch.preallocate, -XX:+UseG1GC, -Djava.io.tmpdir=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp, -XX:ErrorFile=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\logs\es_hs_err_pid%p.log, -Xlog:disable, -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, -Djna.tmpdir=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Dcom.redhat.fips=false, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, -Des.distribution.type=tar, --module-path=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch\lib, --add-modules=jdk.net, --add-modules=ALL-MODULE-PATH, -Djdk.module.main=org.elasticsearch.server]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-core]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [old-lucene-versions]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [rest-root]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-redact]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-security]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [aggregations]
2024.01.20 12:03:07 INFO  es[][o.e.p.PluginsService] loaded module [apm]
2024.01.20 12:03:09 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[SSD OS (C:)]], net usable_space [135.2gb], net total_space [930.9gb], types [NTFS]
2024.01.20 12:03:09 INFO  es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2024.01.20 12:03:09 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [Ps_kJKpeSt-_zGivas7DlA], cluster name [sonarqube], roles [ingest, data_frozen, ml, data_hot, transform, data_content, data_warm, master, remote_cluster_client, data, data_cold]
2024.01.20 12:03:09 INFO  es[][o.e.x.s.Security] Security is disabled
2024.01.20 12:03:10 INFO  es[][o.e.t.n.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=1mb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=4mb, heap_size=512mb}]
2024.01.20 12:03:10 INFO  es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2024.01.20 12:03:10 INFO  es[][o.e.d.DiscoveryModule] using discovery type [single-node] and seed hosts providers [settings]
2024.01.20 12:03:10 INFO  es[][o.e.n.Node] initialized
2024.01.20 12:03:10 INFO  es[][o.e.n.Node] starting ...
2024.01.20 12:03:10 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:65285}, bound_addresses {127.0.0.1:65285}
2024.01.20 12:03:10 INFO  es[][o.e.c.c.ClusterBootstrapService] this node is locked into cluster UUID [WO3wQG8gQjOcTmn-CJIpFA] and will not attempt further cluster bootstrapping
2024.01.20 12:03:10 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined in term 2)[_FINISH_ELECTION_, {sonarqube}{Ps_kJKpeSt-_zGivas7DlA}{WTU8YqncQCSLO2nTSsnbrQ}{sonarqube}{127.0.0.1}{127.0.0.1:65285}{cdfhilmrstw}{8.11.0}{7000099-8500003} completing election], term: 2, version: 2, delta: master node changed {previous [], current [{sonarqube}{Ps_kJKpeSt-_zGivas7DlA}{WTU8YqncQCSLO2nTSsnbrQ}{sonarqube}{127.0.0.1}{127.0.0.1:65285}{cdfhilmrstw}{8.11.0}{7000099-8500003}]}
2024.01.20 12:03:10 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{Ps_kJKpeSt-_zGivas7DlA}{WTU8YqncQCSLO2nTSsnbrQ}{sonarqube}{127.0.0.1}{127.0.0.1:65285}{cdfhilmrstw}{8.11.0}{7000099-8500003}]}, term: 2, version: 2, reason: Publication{term=2, version=2}
2024.01.20 12:03:10 INFO  es[][o.e.c.f.AbstractFileWatchingService] starting file watcher ...
2024.01.20 12:03:10 INFO  es[][o.e.c.f.AbstractFileWatchingService] file settings service up and running [tid=68]
2024.01.20 12:03:10 INFO  es[][o.e.c.c.NodeJoinExecutor] node-join: [{sonarqube}{Ps_kJKpeSt-_zGivas7DlA}{WTU8YqncQCSLO2nTSsnbrQ}{sonarqube}{127.0.0.1}{127.0.0.1:65285}{cdfhilmrstw}{8.11.0}{7000099-8500003}] with reason [completing election]
2024.01.20 12:03:10 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2024.01.20 12:03:10 INFO  es[][o.e.n.Node] started {sonarqube}{Ps_kJKpeSt-_zGivas7DlA}{WTU8YqncQCSLO2nTSsnbrQ}{sonarqube}{127.0.0.1}{127.0.0.1:65285}{cdfhilmrstw}{8.11.0}{7000099-8500003}{rack_id=sonarqube, xpack.installed=true}
2024.01.20 12:15:08 WARN  es[][o.a.l.i.v.VectorizationProvider] Java vector incubator module is not readable. For optimal vector performance, pass --add-modules jdk.incubator.vector to enable Vector API.
2024.01.20 12:15:08 INFO  es[][o.e.n.Node] version[8.11.0], pid[5460], build[tar/d9ec3fa628c7b0ba3d25692e277ba26814820b20/2023-11-04T10:04:57.184859352Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/21.0.2/21.0.2+13-LTS-58]
2024.01.20 12:15:08 INFO  es[][o.e.n.Node] JVM home [C:\Program Files\Java\jdk-21], using bundled JDK [false]
2024.01.20 12:15:08 INFO  es[][o.e.n.Node] JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -Djava.security.manager=allow, -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, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=org.elasticsearch.preallocate, -XX:+UseG1GC, -Djava.io.tmpdir=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp, -XX:ErrorFile=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\logs\es_hs_err_pid%p.log, -Xlog:disable, -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, -Djna.tmpdir=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Dcom.redhat.fips=false, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, -Des.distribution.type=tar, --module-path=C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\elasticsearch\lib, --add-modules=jdk.net, --add-modules=ALL-MODULE-PATH, -Djdk.module.main=org.elasticsearch.server]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-core]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [old-lucene-versions]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [rest-root]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-redact]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-security]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [aggregations]
2024.01.20 12:15:09 INFO  es[][o.e.p.PluginsService] loaded module [apm]
2024.01.20 12:15:10 ERROR es[][o.e.b.Elasticsearch] fatal exception while booting Elasticsearch
java.lang.IllegalStateException: failed to obtain node locks, tried [C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\data\es8]; maybe these locations are not writable or multiple nodes were started on the same data path?
	at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:294) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.node.Node.<init>(Node.java:499) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.node.Node.<init>(Node.java:344) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch$2.<init>(Elasticsearch.java:236) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.initPhase3(Elasticsearch.java:236) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73) ~[elasticsearch-8.11.0.jar:?]
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock held by another program: C:\Users\MaxMaster\Downloads\sonarqube-10.3.0.82913\sonarqube-10.3.0.82913\data\es8\node.lock
	at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:117) ~[lucene-core-9.8.0.jar:?]
	at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:43) ~[lucene-core-9.8.0.jar:?]
	at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:44) ~[lucene-core-9.8.0.jar:?]
	at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:232) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:206) ~[elasticsearch-8.11.0.jar:?]
	at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:286) ~[elasticsearch-8.11.0.jar:?]
	... 5 more

Please help, thank you.

Hi,

Welcome to the community!

This is the root error

Off hand it looks like a permissions problem…?

 
HTH,
Ann