Issue with running SonarQube Community Edition on Windows Server 2022

Hi,
I’m trying to run SonarQube community edition on a windows server 2022 but I’m not having any luck. It seems like it gets stuck on waiting for Elastic Search to start and that never happens. I have installed Java JDK 21 and PostgreSql 16 on that machine. So, everything is running locally. The following is what I see on the console when I try to run the StartSonar.bat as well as what I see in the different log files. Any thoughts?

------------------- What's on the command console-------------------------
Starting SonarQube...
2024.02.08 17:30:03 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-10.4.0.87286\temp
2024.02.08 17:30:04 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:52085]
2024.02.08 17:30:04 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\sonarqube-10.4.0.87286\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:\sonarqube-10.4.0.87286\elasticsearch -Des.path.conf=C:\sonarqube-10.4.0.87286\temp\conf\es -Des.distribution.type=tar -cp C:\sonarqube-10.4.0.87286\elasticsearch\lib\*;C:\sonarqube-10.4.0.87286\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2024.02.08 17:30:04 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Feb 08, 2024 5:30:09 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release
---------------------------- es.log -----------------------------------------
2024.02.08 17:30:10 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.02.08 17:30:11 INFO  es[][o.e.n.Node] version[8.11.0], pid[5852], build[tar/d9ec3fa628c7b0ba3d25692e277ba26814820b20/2023-11-04T10:04:57.184859352Z], OS[Windows Server 2022/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/21.0.2/21.0.2+13-LTS-58]
2024.02.08 17:30:11 INFO  es[][o.e.n.Node] JVM home [C:\Program Files\Java\jdk-21], using bundled JDK [false]
2024.02.08 17:30:11 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:\sonarqube-10.4.0.87286\temp, -XX:ErrorFile=C:\sonarqube-10.4.0.87286\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:\sonarqube-10.4.0.87286\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, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, -Des.distribution.type=tar, --module-path=C:\sonarqube-10.4.0.87286\elasticsearch\lib, --add-modules=jdk.net, --add-modules=ALL-MODULE-PATH, -Djdk.module.main=org.elasticsearch.server]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-core]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [old-lucene-versions]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [rest-root]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-redact]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-security]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [aggregations]
2024.02.08 17:30:13 INFO  es[][o.e.p.PluginsService] loaded module [apm]
2024.02.08 17:30:17 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[(C:)]], net usable_space [8.7gb], net total_space [29.9gb], types [NTFS]
2024.02.08 17:30:17 INFO  es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2024.02.08 17:30:17 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [rnFpBVQPReWqu5TrNWRl2Q], cluster name [sonarqube], roles [data_cold, data, remote_cluster_client, master, data_warm, data_content, transform, data_hot, ml, data_frozen, ingest]
2024.02.08 17:30:18 INFO  es[][o.e.x.s.Security] Security is disabled
2024.02.08 17:30:18 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.02.08 17:30:19 INFO  es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2024.02.08 17:30:19 INFO  es[][o.e.d.DiscoveryModule] using discovery type [single-node] and seed hosts providers [settings]
2024.02.08 17:30:20 INFO  es[][o.e.n.Node] initialized
2024.02.08 17:30:20 INFO  es[][o.e.n.Node] starting ...
2024.02.08 17:30:20 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:52085}, bound_addresses {127.0.0.1:52085}
2024.02.08 17:30:20 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2024.02.08 17:30:20 INFO  es[][o.e.c.c.ClusterBootstrapService] this node has not joined a bootstrapped cluster yet; [cluster.initial_master_nodes] is set to [sonarqube]
2024.02.08 17:30:20 INFO  es[][o.e.c.c.Coordinator] setting initial configuration to VotingConfiguration{rnFpBVQPReWqu5TrNWRl2Q}
2024.02.08 17:30:20 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined in term 1)[_FINISH_ELECTION_, {sonarqube}{rnFpBVQPReWqu5TrNWRl2Q}{yABUToiiQgOk9EVZICE9Nw}{sonarqube}{127.0.0.1}{127.0.0.1:52085}{cdfhilmrstw}{8.11.0}{7000099-8500003} completing election], term: 1, version: 1, delta: master node changed {previous [], current [{sonarqube}{rnFpBVQPReWqu5TrNWRl2Q}{yABUToiiQgOk9EVZICE9Nw}{sonarqube}{127.0.0.1}{127.0.0.1:52085}{cdfhilmrstw}{8.11.0}{7000099-8500003}]}
2024.02.08 17:30:20 INFO  es[][o.e.c.c.CoordinationState] cluster UUID set to [ZgxPQ8t4RauN1HcrxluI_A]
2024.02.08 17:30:20 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{rnFpBVQPReWqu5TrNWRl2Q}{yABUToiiQgOk9EVZICE9Nw}{sonarqube}{127.0.0.1}{127.0.0.1:52085}{cdfhilmrstw}{8.11.0}{7000099-8500003}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
2024.02.08 17:30:20 INFO  es[][o.e.c.f.AbstractFileWatchingService] starting file watcher ...
2024.02.08 17:30:20 INFO  es[][o.e.c.c.NodeJoinExecutor] node-join: [{sonarqube}{rnFpBVQPReWqu5TrNWRl2Q}{yABUToiiQgOk9EVZICE9Nw}{sonarqube}{127.0.0.1}{127.0.0.1:52085}{cdfhilmrstw}{8.11.0}{7000099-8500003}] with reason [completing election]
2024.02.08 17:30:20 INFO  es[][o.e.c.f.AbstractFileWatchingService] file settings service up and running [tid=36]
2024.02.08 17:30:20 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2024.02.08 17:30:20 INFO  es[][o.e.n.Node] started {sonarqube}{rnFpBVQPReWqu5TrNWRl2Q}{yABUToiiQgOk9EVZICE9Nw}{sonarqube}{127.0.0.1}{127.0.0.1:52085}{cdfhilmrstw}{8.11.0}{7000099-8500003}{xpack.installed=true, rack_id=sonarqube}
------------------------ sonar.log --------------------------------------------
2024.02.08 17:30:03 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-10.4.0.87286\temp
2024.02.08 17:30:04 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:52085]
2024.02.08 17:30:04 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\sonarqube-10.4.0.87286\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:\sonarqube-10.4.0.87286\elasticsearch -Des.path.conf=C:\sonarqube-10.4.0.87286\temp\conf\es -Des.distribution.type=tar -cp C:\sonarqube-10.4.0.87286\elasticsearch\lib\*;C:\sonarqube-10.4.0.87286\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2024.02.08 17:30:04 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
----------------------- SonarServiceWrapper.wrapper.log -------------------------
2024-02-08 17:30:02,947 DEBUG - Starting WinSW in console mode

Welcome :slight_smile:

Sonarqube 10.4 has still Java 17 as requirement for the server.
see Prerequisites and overview

So you should try with Java 17 instead of Java 21 first.
It’s not recommended to install Sonarqube and the database on the same machine, Sonarqube
should run on a dedicated machine / VM.

Try with Java 17, then if still problems post the whole es.log

Gilbert

That worked. Thank you so much.

1 Like

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