SonarQube v10.0.0

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) - v10.0.0
  • how is SonarQube deployed: zip, Docker, Helm -zip
  • what are you trying to achieve sonarqube to be operational
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hello there,

I am trying to install sonarqube 10.0.0 on RHEL8 machine with a fresh installation.
We have openjdk 17 installed on the system.
CPU 4 core
RAM 16GB
Upon installation and assigning sonar user I have been seeing this on the logs and nothing happens
I have followed all the steps per doc. Nothing changes even after stopping the firewalld.
The sonar.properties file is the default which comes out of the zip file. Nothing has been configured there yet.
Logs:

2023.07.19 04:08:53 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.07.19 04:08:53 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2023.07.19 04:08:55 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2023.07.19 04:08:55 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:42989]
2023.07.19 04:08:55 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube/elasticsearch]: /usr/lib/jvm/java-17-openjdk-17.0.7.0.7-3.el8.x86_64/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/opt/sonarqube/elasticsearch -Des.path.conf=/opt/sonarqube/temp/conf/es -Des.distribution.type=tar -cp /opt/sonarqube/elasticsearch/lib/*:/opt/sonarqube/elasticsearch/lib/cli-launcher/* org.elasticsearch.launcher.CliToolLauncher
2023.07.19 04:08:55 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running

This is the error I am seeing at systemd status log

at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:60)
ed by: java.lang.ClassNotFoundException: joptsimple.OptionSpec
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 2 more
.07.19 05:26:32 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
.07.19 05:26:32 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
.07.19 05:26:32 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
e.service: Succeeded.

Can someone suggest what can be the fix for this ?

Thanks
Bipin Guragain

Hi Bipin,

This isn’t enough of the logs to diagnose the problem. At a minimum, we need at least a few lines before the error begins, and we need all the columns on the left. :smiley: (It looks like you managed to copy/paste while omitting the first few columns of text.)

 
Ann

Hi Ann,

These are the logs I found from sonar.log

2023.07.25 17:32:01 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /loc01/sonarqube/temp
2023.07.25 17:32:01 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:33013]
2023.07.25 17:32:01 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/loc01/sonarqube/elasticsearch]: /usr/lib/jvm/java-17-openjdk-17.0.7.0.7-3.el8.x86_64/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/loc01/sonarqube/elasticsearch -Des.path.conf=/loc01/sonarqube/temp/conf/es -Des.distribution.type=tar -cp /loc01/sonarqube/elasticsearch/lib/*:/loc01/sonarqube/elasticsearch/lib/cli-launcher/* org.elasticsearch.launcher.CliToolLauncher
2023.07.25 17:32:01 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.07.25 17:32:03 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2023.07.25 17:32:03 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.07.25 17:32:03 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2023.07.25 17:37:17 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /loc01/sonarqube/temp
2023.07.25 17:37:17 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:34775]
2023.07.25 17:37:17 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/loc01/sonarqube/elasticsearch]: /usr/lib/jvm/java-17-openjdk-17.0.7.0.7-3.el8.x86_64/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/loc01/sonarqube/elasticsearch -Des.path.conf=/loc01/sonarqube/temp/conf/es -Des.distribution.type=tar -cp /loc01/sonarqube/elasticsearch/lib/*:/loc01/sonarqube/elasticsearch/lib/cli-launcher/* org.elasticsearch.launcher.CliToolLauncher
2023.07.25 17:37:17 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.07.25 17:37:26 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2023.07.25 17:37:26 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.07.25 17:37:26 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2023.07.25 17:39:22 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /loc01/sonarqube/temp
2023.07.25 17:39:22 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:34805]
2023.07.25 17:39:22 ERROR app[][o.s.a.p.ManagedProcessHandler] Failed to launch process [ElasticSearch]
java.lang.IllegalStateException: Could not delete Elasticsearch temporary conf directory
        at org.sonar.application.ProcessLauncherImpl.pruneElasticsearchConfDirectory(ProcessLauncherImpl.java:154)
        at org.sonar.application.ProcessLauncherImpl.writeConfFiles(ProcessLauncherImpl.java:141)
        at org.sonar.application.ProcessLauncherImpl.launch(ProcessLauncherImpl.java:90)
        at org.sonar.application.SchedulerImpl.lambda$tryToStartProcess$2(SchedulerImpl.java:192)
        at org.sonar.application.process.ManagedProcessHandler.start(ManagedProcessHandler.java:76)
        at org.sonar.application.SchedulerImpl.tryToStartProcess(SchedulerImpl.java:190)
        at org.sonar.application.SchedulerImpl.tryToStartEs(SchedulerImpl.java:142)
        at org.sonar.application.SchedulerImpl.tryToStartAll(SchedulerImpl.java:134)
        at org.sonar.application.SchedulerImpl.schedule(SchedulerImpl.java:113)
        at org.sonar.application.App.start(App.java:59)
        at org.sonar.application.App.main(App.java:81)
Caused by: java.nio.file.AccessDeniedException: /loc01/sonarqube/temp/conf/es
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:248)
        at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
        at java.base/java.nio.file.Files.deleteIfExists(Files.java:1191)
        at org.sonar.application.ProcessLauncherImpl.pruneElasticsearchConfDirectory(ProcessLauncherImpl.java:152)
        ... 10 common frames omitted
2023.07.25 17:39:22 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.07.25 17:39:22 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2023.07.25 17:39:22 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.07.25 17:43:30 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /loc01/sonarqube/temp
2023.07.25 17:43:30 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:36797]
2023.07.25 17:43:30 ERROR app[][o.s.a.p.ManagedProcessHandler] Failed to launch process [ElasticSearch]
java.lang.IllegalStateException: Could not delete Elasticsearch temporary conf directory
        at org.sonar.application.ProcessLauncherImpl.pruneElasticsearchConfDirectory(ProcessLauncherImpl.java:154)

sonar.log

Hi,

What do you make of that error?

 
Ann

I am using systemd to start the sonarqube service. Those are the logs I found. Not sure what you mean by make of this error.

Hi,

What does this mean to you?

 
Ann

Yes we have fixed that permission issue.

It is still failing with this error.

 sonarqube.service - SonarQube service
   Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Thu 2023-07-27 15:22:42 UTC; 29s ago
  Process: 124015 ExecStart=/bin/nohup /usr/lib/jvm/java-17-openjdk-17.0.2.0.8-4.el8_5.x86_64/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -j>
 Main PID: 124015 (code=exited, status=0/SUCCESS)

Jul 27 15:22:42  nohup[124015]:         at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:60)
Jul 27 15:22:42 nohup[124015]: Caused by: java.lang.ClassNotFoundException: joptsimple.OptionSpec
Jul 27 15:22:42  nohup[124015]:         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLo>
Jul 27 15:22:42  nohup[124015]:         at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Class>
Jul 27 15:22:42  nohup[124015]:         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
Jul 27 15:22:42  nohup[124015]:         ... 2 more
Jul 27 15:22:42  nohup[124015]: 2023.07.27 15:22:42 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with >
Jul 27 15:22:42  nohup[124015]: 2023.07.27 15:22:42 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopp>
Jul 27 15:22:42  nohup[124015]: 2023.07.27 15:22:42 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
Jul 27 15:22:42  systemd[1]: sonarqube.service: Succeeded.

This the es.log

[root@host logs]# vi es.log
2023.07.26 22:39:11 ERROR es[][o.e.b.Elasticsearch] fatal exception while booting Elasticsearch
java.lang.ExceptionInInitializerError: null
        at org.elasticsearch.bootstrap.JNANatives.definitelyRunningAsRoot(JNANatives.java:162) ~[elasticsearch-8.6.1.jar:?]
        at org.elasticsearch.bootstrap.Natives.definitelyRunningAsRoot(Natives.java:57) ~[elasticsearch-8.6.1.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initializeNatives(Elasticsearch.java:259) ~[elasticsearch-8.6.1.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:166) ~[elasticsearch-8.6.1.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:66) ~[elasticsearch-8.6.1.jar:?]
Caused by: java.lang.UnsupportedOperationException: Failed to allocate closure
        at com.sun.jna.Native.registerMethod(Native Method) ~[jna-5.10.0.jar:?]
        at com.sun.jna.Native.register(Native.java:1906) ~[jna-5.10.0.jar:?]
        at com.sun.jna.Native.register(Native.java:1775) ~[jna-5.10.0.jar:?]
        at com.sun.jna.Native.register(Native.java:1493) ~[jna-5.10.0.jar:?]
        at org.elasticsearch.bootstrap.JNACLibrary.<clinit>(JNACLibrary.java:38) ~[elasticsearch-8.6.1.jar:?]
        ... 5 more

We recently upgraded to v10.0.0 on RHEL7 without having any issues while the issue above is on RHEL8.

Hi,

Elasticsearch won’t run as root.

 
Ann

I do not think so. We have created a sonartest user with no logon and configured to run the service using the sonartest. All the applications files are owned by sonartest user and systemd service file has user and group pointed to sonartest.

Definitely something else could be here which I am not sure.

This has been resolved now. It is mostly with the RHEL8 conffiguration we have in place within the organization. Thank you @ganncamp for all your inputs.

1 Like