Trying to start sonarqube but getting this error as Removed stale pid file: ./SonarQube.pid

Hi,

Has the above solution worked?

For me, it didn’t. Could you help me out?

@silju007 Not worked. Try installing sonar as docker container.

yes it is working . try it once

you are trying in WSL?

you need to put permissions# chmod -R 775 /opt/sonarqube (sonarqube dir also)
also if are started sonarqube as root users it will created the temp dir in sonarqube dir . inthat case you need to delete that temp dir and stwitch to root user then after start sonarqube # sh sonar.sh start, #sh sonar.sh status. hope it works

Hi All,

I am getting the sam error. tried all the steps given, But it is not working for me. Can someone help here please? Please find the details below. Also I could not find RUN_AS_USER in my sonar.ssh file so I used the fix given : Update to sonarqube-9.6.0.59041 missing files - #20 by Ahmad_Abu_Hashem
Not sure what is the issue

sonarqube 9.9.3 version in linux. Please find the logs below. When I start the sonar.sh file it shows “Removed stale pid file: ./SonarQube.pid”. I am using postgresql15 as database, with JDK version 17

es.log

2023.11.22 08:10:33 INFO es[o.e.n.Node] version[7.17.8], pid[31914], build[default/tar/120eabe1c8a0cb2ae87cffc109a5b65d213e9df1/2022-12-02T17:33:09.727072865Z], OS[Linux/6.1.61-85.141.amzn2023.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot™ 64-Bit Server VM/17.0.9/17.0.9+11-LTS-201]
2023.11.22 08:10:33 INFO es[o.e.n.Node] JVM home [/usr/local/jdk-17.0.9]
2023.11.22 08:10:33 INFO es[o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=/opt/sonarqube/logs/es_hs_err_pid%p.log, -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=/opt/sonarqube/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, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=false]
2023.11.22 08:10:34 INFO es[o.e.p.PluginsService] loaded module [analysis-common]
2023.11.22 08:10:34 INFO es[o.e.p.PluginsService] loaded module [lang-painless]
2023.11.22 08:10:34 INFO es[o.e.p.PluginsService] loaded module [parent-join]
2023.11.22 08:10:34 INFO es[o.e.p.PluginsService] loaded module [reindex]
2023.11.22 08:10:34 INFO es[o.e.p.PluginsService] loaded module [transport-netty4]
2023.11.22 08:10:34 INFO es[o.e.p.PluginsService] no plugins loaded
2023.11.22 08:10:34 INFO es[o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [5.2gb], net total_space [7.9gb], types [xfs]
2023.11.22 08:10:34 INFO es[o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2023.11.22 08:10:34 INFO es[o.e.n.Node] node name [sonarqube], node ID [PfUj2e4hRieD0axsGnBf2g], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2023.11.22 08:10:37 INFO es[o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
2023.11.22 08:10:38 INFO es[o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2023.11.22 08:10:38 INFO es[o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2023.11.22 08:10:38 INFO es[o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2023.11.22 08:10:38 INFO es[o.e.n.Node] initialized
2023.11.22 08:10:38 INFO es[o.e.n.Node] starting …
2023.11.22 08:10:38 INFO es[o.e.t.TransportService] publish_address {127.0.0.1:43303}, bound_addresses {127.0.0.1:43303}
2023.11.22 08:10:38 INFO es[o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2023.11.22 08:10:38 ERROR es[o.e.b.Bootstrap] node validation exception
[1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
2023.11.22 08:10:38 INFO es[o.e.n.Node] stopping …
2023.11.22 08:10:38 INFO es[o.e.n.Node] stopped
2023.11.22 08:10:38 INFO es[o.e.n.Node] closing …
2023.11.22 08:10:38 INFO es[o.e.n.Node] closed

sonar.log

2023.11.22 08:10:31 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2023.11.22 08:10:31 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:43303]
2023.11.22 08:10:31 INFO app[o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2023.11.22 08:10:31 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.11.22 08:10:39 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 78
2023.11.22 08:10:39 INFO app[o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.11.22 08:10:39 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped

The issue was
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Resolved it : Prerequisites and overview

Hi Everyone

I am also facing the same issue. I have followed below steps to start the sonarqube but no use.
[root@ip-172-31-7-251 ~]# su - sonar
Last login: Wed Apr 3 10:18:14 UTC 2024 on pts/2
[sonar@ip-172-31-7-251 ~]$ cd /opt/sonarqube/bin/linux-x86-64/
[sonar@ip-172-31-7-251 linux-x86-64]$ ls
sonar.sh
[sonar@ip-172-31-7-251 linux-x86-64]$ sh sonar.sh start
/usr/bin/java
Starting SonarQube…
Started SonarQube.
[sonar@ip-172-31-7-251 linux-x86-64]$ sh sonar.sh status
/usr/bin/java
Removed stale pid file: ./SonarQube.pid
SonarQube is not running.

I haven’t found errors in logs.

[sonar@ip-172-31-7-251 sonarqube]$ cd logs
[sonar@ip-172-31-7-251 logs]$ ls -l
total 8
-rwxr-xr-x. 1 sonar sonar 88 Feb 6 14:19 README.txt
-rw-r–r–. 1 sonar sonar 317 Apr 3 10:21 nohup.log

Please help me out on this issue

Hi Everyone

Now I am able to run the SonarQube.

Initially I installed java 11 and sonarqube-9.9.4.87374.zip versions. → It didn’t work

Later I changed the versions which are java 17 and sonarqube-9.9.4.87374.zip → It works.

I think it is a version compatibility issue. let’s try this one.