Unable to setup SonarQube for python in centos 7
NickName:joel Ask DateTime:2020-07-03T02:55:45

Unable to setup SonarQube for python in centos 7

I am trying to get SonarQube for python up and running in centos. I have downloaded this version : sonarqube-8.3.1.34397.zip.

I have installed java 11.

java -version

openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

conf/wrapper.conf

wrapper.java.command=/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.el7_8.x86_64/bin/java

Running ./bin/linux-x86-64/sonar.sh console as Root user, I get following error

Running SonarQube...
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    | 
jvm 1    | 2020.07.03 00:19:28 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
jvm 1    | 2020.07.03 00:19:28 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1    | 2020.07.03 00:19:29 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
jvm 1    | 2020.07.03 00:19:29 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
jvm 1    | 2020.07.03 00:19:29 INFO  app[][o.e.p.PluginsService] no modules loaded
jvm 1    | 2020.07.03 00:19:29 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1    | 2020.07.03 00:19:31 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
jvm 1    | 2020.07.03 00:19:31 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
jvm 1    | 2020.07.03 00:19:31 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper  | <-- Wrapper Stopped

Running ./bin/linux-x86-64/sonar.sh console as normal user, I get following error

Running SonarQube...
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    | 
jvm 1    | 2020.07.03 00:20:45 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
jvm 1    | 2020.07.03 00:20:45 ERROR app[][o.s.application.App] Startup failure
jvm 1    | java.lang.IllegalArgumentException: Unable to create shared memory : 
jvm 1    |  at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:103)
jvm 1    |  at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:63)
jvm 1    |  at org.sonar.application.App.start(App.java:63)
jvm 1    |  at org.sonar.application.App.main(App.java:98)
jvm 1    |  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
jvm 1    |  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
jvm 1    |  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
jvm 1    |  at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1    |  at java.base/java.lang.Thread.run(Thread.java:834)
jvm 1    | Caused by: java.io.FileNotFoundException: /opt/sonarqube/temp/sharedmemory (Permission denied)
jvm 1    |  at java.base/java.io.RandomAccessFile.open0(Native Method)
jvm 1    |  at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:345)
jvm 1    |  at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
jvm 1    |  at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:214)
jvm 1    |  at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:100)
jvm 1    |  ... 9 common frames omitted
wrapper  | <-- Wrapper Stopped

Output of sonar.log file

--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.


WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11 to run
java.lang.IllegalStateException: SonarQube requires Java 11 to run
    at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
    at org.sonar.application.App.checkJavaVersion(App.java:94)
    at org.sonar.application.App.start(App.java:57)
    at org.sonar.application.App.main(App.java:98)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
    at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.


WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11 to run
java.lang.IllegalStateException: SonarQube requires Java 11 to run
    at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
    at org.sonar.application.App.checkJavaVersion(App.java:94)
    at org.sonar.application.App.start(App.java:57)
    at org.sonar.application.App.main(App.java:98)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
    at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.02 23:40:34 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.02 23:40:34 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.02 23:40:34 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.02 23:40:34 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.02 23:40:35 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.02 23:40:35 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.02 23:40:38 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.02 23:40:38 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.02 23:40:38 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.02 23:57:56 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.02 23:57:56 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.02 23:57:56 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.02 23:57:57 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.02 23:57:57 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.02 23:57:57 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.02 23:58:00 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.02 23:58:00 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.02 23:58:00 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.03 00:08:31 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.03 00:08:31 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.03 00:08:31 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.03 00:08:31 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.03 00:08:32 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.03 00:08:32 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.03 00:08:34 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.03 00:08:34 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.03 00:08:34 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.03 00:13:22 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.03 00:13:22 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.03 00:13:22 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.03 00:13:22 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.03 00:13:23 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.03 00:13:23 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.03 00:13:25 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.03 00:13:25 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.03 00:13:25 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.03 00:13:33 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.03 00:13:33 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.03 00:13:33 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.03 00:13:33 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.03 00:13:34 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.03 00:13:34 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.03 00:13:36 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.03 00:13:36 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.03 00:13:36 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.03 00:13:48 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.03 00:13:48 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.03 00:13:48 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.03 00:13:48 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.03 00:13:48 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.03 00:13:48 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.03 00:13:50 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.03 00:13:50 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.03 00:13:50 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.03 00:14:03 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.03 00:14:03 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.03 00:14:03 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.03 00:14:03 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.03 00:14:04 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.03 00:14:04 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.03 00:14:06 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.03 00:14:06 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.03 00:14:06 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.07.03 00:19:28 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.07.03 00:19:28 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.07.03 00:19:29 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.07.03 00:19:29 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.07.03 00:19:29 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.07.03 00:19:29 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.03 00:19:31 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.03 00:19:31 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.03 00:19:31 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped

Copyright Notice:Content Author:「joel」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62703242/unable-to-setup-sonarqube-for-python-in-centos-7

Answers
Sourav 2021-02-28T04:08:16

For SonarQube to install from zip, you need to create a dedicated user which have access to your Java 11 installation and as well all the files of SonarQube installation directory.\nThen start your SonarQube server with that user.\nDo not use root user to start the SonarQube server.\nHere is the link to documentation, where SonarQube has mentioned this: https://docs.sonarqube.org/8.3/setup/install-server/\nHere is the guide to help you with Installation:\n\nhttps://devopscube.com/setup-and-configure-sonarqube-on-linux/\n\nhttps://docs.sonarqube.org/8.3/setup/get-started-2-minutes/\n\n",


More about “Unable to setup SonarQube for python in centos 7” related questions

Unable to setup SonarQube for python in centos 7

I am trying to get SonarQube for python up and running in centos. I have downloaded this version : sonarqube-8.3.1.34397.zip. I have installed java 11. java -version openjdk version &quot;11.0.7&qu...

Show Detail

Sonarqube - service sonar does not support chkconfig in centos 7

Followed sonarqube setup instructions from below link. But executing chkconfig command failed. It is blocking me to start the sonarqube as service in centos7. http://docs.sonarqube.org/display/SO...

Show Detail

kubernetes setup on baremetal centos 7

I am trying to deploy kubernetes on "CentOS Linux release 7.0.1406" using "yum install kubernetes" Which installs "kubernetes-0.17.1-4.el7.x86_64". I am unable to understand how I can get the latest

Show Detail

Kubernetes setup on centos 7 hangs

I have setup of 1 master and 2 salves of kubernetes on centos machines. Also there is dashboard for kubernetes and 6 spring boot services. The mongodb is installed as service on master node. The se...

Show Detail

Unable to install chromium in my centOS7

I have this Unable to install chromium in my centOS problem in Centos7. Suggested solution does not work in 7. It's missing libude.so dependency.

Show Detail

Sonarqube Loading for ever

I have setup my sonarqube server in centos 7. I am using sonarqube 7.4. I have installed httpd and trying to access sonarqube dashboard. This will load for ever as I attached in image. Loading.......

Show Detail

How to change Default Python for Salt in CentOS 7?

I am trying to setup a salt-master/salt-cloud on Centos 7. The issue that I am having is that I need Python 2.7.13 to use salt-cloud to clone vm in vmware vcenter (uses pyvmomi). CentOS comes with ...

Show Detail

Using Centos v7 for Setup a New Cluster

I want to setup a cluster of Hadoop. Is there any problem if i use Centos v7 for operating system? I already use Centos 6.5 and in this setup i want to use the newest version.

Show Detail

Python 3.5 CentOS 7

I have massacred my Centos 7 release trying to get python 3.5 and pip working. After installing from source and trying lots of things I won't get into I found the following guide: https://www.

Show Detail

How to setup sonarqube for Angular 7 project

Trying to setup Sonarqube for Angular 7 code base for code coverage analysis. I have Installed the Sonarqube and created a project in Admin after getting the Authorization cmd "sonar-scanner.bat -D"

Show Detail