Sonarqube is stopping after a while

I am trying to install sonarqube in WSL its is sucessfully start after some time its stopping

image

 cat es.log
2023.11.01 10:46:29 INFO  es[][o.e.n.Node] version[7.17.8], pid[219], build[default/tar/120eabe1c8a0cb2ae87cffc109a5b65d213e9df1/2022-12-02T17:33:09.727072865Z], OS[Linux/5.10.16.3-microsoft-standard-WSL2/amd64], JVM[Private Build/OpenJDK 64-Bit Server VM/17.0.8.1/17.0.8.1+1-Ubuntu-0ubuntu122.04]
2023.11.01 10:46:29 INFO  es[][o.e.n.Node] JVM home [/usr/lib/jvm/java-17-openjdk-amd64]
2023.11.01 10:46:29 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.01 10:46:30 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2023.11.01 10:46:30 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2023.11.01 10:46:30 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2023.11.01 10:46:30 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2023.11.01 10:46:30 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2023.11.01 10:46:30 INFO  es[][o.e.p.PluginsService] no plugins loaded
2023.11.01 10:46:30 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/sdb)]], net usable_space [235.3gb], net total_space [250.9gb], types [ext4]
2023.11.01 10:46:30 INFO  es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2023.11.01 10:46:30 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [Wuz-Eq_sQL6GZ_L_UuUP2A], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2023.11.01 10:46:35 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.01 10:46:35 INFO  es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2023.11.01 10:46:35 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2023.11.01 10:46:35 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.01 10:46:36 INFO  es[][o.e.n.Node] initialized
2023.11.01 10:46:36 INFO  es[][o.e.n.Node] starting ...
2023.11.01 10:46:36 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:33823}, bound_addresses {127.0.0.1:33823}
2023.11.01 10:46:36 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2023.11.01 10:46:36 ERROR es[][o.e.b.Bootstrap] node validation exception
[2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch.
bootstrap check failure [1] of [2]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
bootstrap check failure [2] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
2023.11.01 10:46:36 INFO  es[][o.e.n.Node] stopping ...
2023.11.01 10:46:36 INFO  es[][o.e.n.Node] stopped
2023.11.01 10:46:36 INFO  es[][o.e.n.Node] closing ...
2023.11.01 10:46:36 INFO  es[][o.e.n.Node] closed
2023.11.01 11:03:06 INFO  es[][o.e.n.Node] version[7.17.8], pid[607], build[default/tar/120eabe1c8a0cb2ae87cffc109a5b65d213e9df1/2022-12-02T17:33:09.727072865Z], OS[Linux/5.10.16.3-microsoft-standard-WSL2/amd64], JVM[Private Build/OpenJDK 64-Bit Server VM/17.0.8.1/17.0.8.1+1-Ubuntu-0ubuntu122.04]
2023.11.01 11:03:06 INFO  es[][o.e.n.Node] JVM home [/usr/lib/jvm/java-17-openjdk-amd64]
2023.11.01 11:03:06 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.01 11:03:07 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2023.11.01 11:03:07 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2023.11.01 11:03:07 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2023.11.01 11:03:07 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2023.11.01 11:03:07 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2023.11.01 11:03:07 INFO  es[][o.e.p.PluginsService] no plugins loaded
2023.11.01 11:03:07 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/sdb)]], net usable_space [235.3gb], net total_space [250.9gb], types [ext4]
2023.11.01 11:03:07 INFO  es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2023.11.01 11:03:07 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [Wuz-Eq_sQL6GZ_L_UuUP2A], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2023.11.01 11:03:12 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.01 11:03:12 INFO  es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2023.11.01 11:03:12 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2023.11.01 11:03:12 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.01 11:03:12 INFO  es[][o.e.n.Node] initialized
2023.11.01 11:03:12 INFO  es[][o.e.n.Node] starting ...
2023.11.01 11:03:12 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:41129}, bound_addresses {127.0.0.1:41129}
2023.11.01 11:03:13 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2023.11.01 11:03:13 ERROR es[][o.e.b.Bootstrap] node validation exception
[2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch.
bootstrap check failure [1] of [2]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
bootstrap check failure [2] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
2023.11.01 11:03:13 INFO  es[][o.e.n.Node] stopping ...
2023.11.01 11:03:13 INFO  es[][o.e.n.Node] stopped
2023.11.01 11:03:13 INFO  es[][o.e.n.Node] closing ...
2023.11.01 11:03:13 INFO  es[][o.e.n.Node] closed

Here you go.

Have a look at the Platform Notes documentation.

yes indeed i did that
My refrence

(https://www.fosstechnix.com/how-to-install-sonarqube-on-ubuntu-22-04-lts/)

It looks like that documentation is for SonarQube v8.9 LTS – some of the required values have changed since then but are still reflected int he tutorial, such as here:

/etc/security/limits.conf

sonarqube   -   nofile   65536
sonarqube   -   nproc    4096

These values should be 131072 and 8192 respectively.

Make sure you’re setting these values as documented in the official documentation.

Now i am getting

image

INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks 2023.11.02 15:42:18 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 file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

What changes are you making, and where are you changing them? If in your /etc/security/limits.conf file, can you share it here?

 cat limits.conf
# /etc/security/limits.conf
sonarqube   -   nofile   131072
sonarqube   -   nproc    8192
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#        - NOTE: group and wildcard limits are not applied to root.
#          To apply a limit to the root user, <domain> must be
#          the literal username root.
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#        - chroot - change root to directory (Debian-specific)
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#root            hard    core            100000
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#ftp             -       chroot          /ftp
#@student        -       maxlogins       4

# End of file

image

Based on your screenshot, you should be specifying the user sonar, not sonarqube

i have changed

sonar   -   nofile   131072
sonar   -   nproc    8192

but still not working

Are you still receiving the same error message?