SonarQube Stopping Unexpectedly on Windows - sonarqube

I'm trying to run SonarQube community edition on my local Windows pc. I launch it via the StartSonar.bat command, but it stops prematurely:
C:\dev\sonarqube-7.5\bin\windows-x86-64>StartSonar.bat
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 | 2019.01.18 23:20:47 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\dev\sonarqube-7.5\temp
jvm 1 | 2019.01.18 23:20:47 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2019.01.18 23:20:47 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\dev\sonarqube-7.5\elasticsearch]: C:\Program Files\Java\jdk1.8.0_112\jre\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\dev\sonarqube-7.5\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=C:\dev\sonarqube-7.5\temp\conf\es
jvm 1 | 2019.01.18 23:20:47 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2019.01.18 23:20:48 INFO app[][o.e.p.PluginsService] no modules loaded
jvm 1 | 2019.01.18 23:20:48 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | 2019.01.18 23:20:49 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
jvm 1 | 2019.01.18 23:20:49 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1 | 2019.01.18 23:20:49 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper | <-- Wrapper Stopped
C:\dev\sonarqube-7.5\bin\windows-x86-64>
Then I check the es log and it shows the following messages regarding not being able to obtain node locks. What does that mean and how do I resolve it?
2019.01.19 00:17:01 WARN es[][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\dev\sonarqube-7.5\data\es5\sonarqube]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\dev\sonarqube-7.5\data\es5\sonarqube]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:261) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
... 6 more
One suggestion I found was to run as a non root user. So I tried the approach described in the answer to this question, running StartSonar.bat as "Run without privilege escalation". Unfortunately, that gave me the same result - as did running run as /trustlevel:0x20000 StartSonar.bat.
Update: When I ran StartSonar.bat again later it worked fine. The es log suggested "multiple nodes" were started. Not sure about that, since localhost:9000 wasn't showing anything. But maybe there was a "collision" of some kind. I had actually previously run sonar from maven (sonar-maven-plugin), which perhaps left a thread running (despite localhost:9000 not showing anything). After I stopped other processes on my machine, presumably including that one, it started working without errors.

Related

SonarQube isn't starting and no error seems to show up in the console output. Could someone help me figure what's wrong?

I'm trying to start SonarQube on a Windows 10 box. I've installed Postgres 10. When I run StartSonar.bat, I get the following:
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 | 2019.02.07 06:22:23 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5\temp
jvm 1 | 2019.02.07 06:22:23 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2019.02.07 06:22:23 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5\elasticsearch]: C:\Program Files\Java\jre1.8.0_201\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5\temp\conf\es
jvm 1 | 2019.02.07 06:22:23 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2019.02.07 06:22:23 INFO app[][o.e.p.PluginsService] no modules loaded
jvm 1 | 2019.02.07 06:22:23 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | 2019.02.07 06:22:34 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
jvm 1 | 2019.02.07 06:22:34 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5]: C:\Program Files\Java\jre1.8.0_201\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5\temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*;C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5\lib\jdbc\postgresql\postgresql-42.2.5.jar org.sonar.server.app.WebServer C:\Users\Administrator\Downloads\sonarqube-7.5\sonarqube-7.5\temp\sq-process8601102404220274862properties
jvm 1 | 2019.02.07 06:22:36 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
jvm 1 | 2019.02.07 06:22:36 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1 | 2019.02.07 06:22:36 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper | <-- Wrapper Stopped
The following are the changes I've made to the sonar.properties file:
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube
# By default, ports will be used on all IP addresses associated with the server.
sonar.web.host=192.0.0.1
# TCP port for incoming HTTP connections. Default value is 9000.
sonar.web.port=9000
# Defaults are respectively <installation home>/data and <installation home>/temp
sonar.path.data=data
sonar.path.temp=temp
The following are screenshots from pgAdmin:
So there were two issues.
The first was due to the sonar.web.host property. I had set it to 192.0.0.1 and after I changed it to 127.0.0.1, this issue was resolved.
The second issue was due to the port the database server was using. After I changed it to the default (i.e. 5432), it worked.

Error in SonarQube Installation and server startup

I have downloaded the sonarqube and unzipped it to a folder.
As per the document ,
i have followed these steps.
Download the SonarQube Community Edition
Unzip it, let's say in C:\sonarqube or /etc/sonarqube
Start the SonarQube Server:
On Windows, execute:
"C:\sonarqube\bin\windows-x86-xx\StartSonar.bat"
Once i execute this, i found the below error.
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 | 2018.12.06 14:11:31 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\Public\SIVA\SoftwareInsatallationFolder\Sonarqube\temp
jvm 1 | 2018.12.06 14:11:31 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2018.12.06 14:11:31 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [D:\Public\SIVA\SoftwareInsatallationFolder\Sonarqube\elasticsearch]: C:\Users\Public\SIVA\SoftwareInsatallationFolder\Java\jre\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=D:\Public\SIVA\SoftwareInsatallationFolder\Sonarqube\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=D:\Public\SIVA\SoftwareInsatallationFolder\Sonarqube\temp\conf\es
jvm 1 | 2018.12.06 14:11:31 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2018.12.06 14:11:32 INFO app[][o.e.p.PluginsService] no modules loaded
jvm 1 | 2018.12.06 14:11:32 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
jvm 1 | WARNING: An illegal reflective access operation has occurred
jvm 1 | WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/D:/Public/SIVA/SoftwareInsatallationFolder/Sonarqube/lib/common/netty-common-4.1.13.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
jvm 1 | WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
jvm 1 | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
jvm 1 | WARNING: All illegal access operations will be denied in a future release
jvm 1 | 2018.12.06 14:11:36 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
jvm 1 | 2018.12.06 14:11:36 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1 | 2018.12.06 14:11:36 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper | <-- Wrapper Stopped
I have run the cmd as administrator , still the error exists.
help me !
Thank you !
You've provided an excerpt from $SONARQUBE_HOME/logs/sonar.log. There are other log files in that directory. Your answer lies in one of them, likely in web.log.
This docs page should help.

Unable to start sonarqube 7.1 on mac

I had downloaded latest sonarqube 7.1. And trying to start using command:
./bin/macosx-universal-64/sonar.sh console
But, It's not get started. Logs are:
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 | 2018.04.26 14:57:34 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /Users/deepakagrawal/softwares/sonarqube-7.1/temp
jvm 1 | 2018.04.26 14:57:34 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2018.04.26 14:57:34 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/Users/deepakagrawal/softwares/sonarqube-7.1/elasticsearch]: /Users/deepakagrawal/softwares/sonarqube-7.1/elasticsearch/bin/elasticsearch -Epath.conf=/Users/deepakagrawal/softwares/sonarqube-7.1/temp/conf/es
jvm 1 | 2018.04.26 14:57:34 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2018.04.26 14:57:34 INFO app[][o.e.p.PluginsService] no modules loaded
jvm 1 | 2018.04.26 14:57:34 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | Error: Could not find or load main class -XX:+UseConcMarkSweepGC
jvm 1 | 2018.04.26 14:57:34 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
jvm 1 | 2018.04.26 14:57:34 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1 | 2018.04.26 14:57:34 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper | <-- Wrapper Stopped
I tried other versions like 7.0. But it's still not working.
I had installed Oracle Java 8.
java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
root user will not work
Looks like elastic search is failing to start. Do not attempt to run sonar as a root. Elastic is designed to prevent you from doing running as root.
$ tail logs/es.log
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.4.jar:6.8.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.4.jar:6.8.4]
... 6 more
If you are running as root:
Prepare system user.
Open sonar.sh find RUN_AS_USER and assign your system user.
Notes
If you were using root to avoid file permission issues and just quickly want to get something running, you can do this instead:
sudo chown $(whoami) temp logs -Rv
After a macOS update to 10.14.5 I got a similar log. I found out that write permissions were removed from /opt/sonarqube/temp/, which are needed by elastic search (ls -l /opt/sonarqube/temp/). After re-adding write permissions using chmod, sonarqube started successfully again.

Failed to start SonarQube in Windows Subsystem (Ubuntu 16.04)

I'm using windows 10 with Ubuntu sub system.I've tried to start server using
/opt/sonar/bin/linux-x86-64/sonar.sh start
But getting error
Starting SonarQube...
Failed to start SonarQube.
**And no logs being generated.**i want to know how can i run sonarqube perfectly in WSL without using root. I know we can’t run sonarqube as root but when I try to start the server using superuser then its being started but sonar not working.
Error Logs:
2018.02.21 07:26:59 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.3.jar:5.6.3]
2018.02.21 07:26:59 WARN es[][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
... 6 more
Sonar Logs:
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2018.02.21 07:26:50 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
2018.02.21 07:26:50 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.02.21 07:26:50 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/elasticsearch]: /opt/sonar/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/temp/conf/es
2018.02.21 07:26:50 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.02.21 07:26:50 INFO app[][o.e.p.PluginsService] no modules loaded
2018.02.21 07:26:50 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.02.21 07:26:59 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2018.02.21 07:26:59 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.02.21 07:26:59 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
Sonarqube has docker server configuration requirements. Same as in the document description.
Because SonarQube uses an embedded Elasticsearch, make sure that your
Docker host configuration complies with the Elasticsearch production
mode requirements and File Descriptors configuration.
For example, on Linux, you can set the recommended values for the
current session by running the following commands as root on the host:
sysctl -w vm.max_map_count=524288
sysctl -w fs.file-max=131072
ulimit -n 131072
ulimit -u 8192
For windows with docker wsl, I have configured
wsl -d docker-desktop
sysctl -w vm.max_map_count=524288
sysctl -w fs.file-max=131072
ulimit -n 131072
And it seems to have worked correctly.
Hope this helps you.

how to launch sonarqube?

for my studies I need to install sonarqube on an ubuntu server.
I installed it following this tutorial : http://www.naturalborncoder.com/methodology/2015/05/27/sonarqube-on-ubuntu-14-04/ (I stopped before the proxying part) but I can't access to 127.0.0.1:9000. From the logs it look like there is a problem with elasticsearch when i launch sonarcube.
/opt/sonar/log/sonar.log :
--> 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.
2017.11.14 18:21:11 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
2017.11.14 18:21:11 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.11.14 18:21:11 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/elasticsearch]: /opt/sonar/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/temp/conf/es
2017.11.14 18:21:11 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.11.14 18:21:13 INFO app[][o.e.p.PluginsService] no modules loaded
2017.11.14 18:21:13 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.elasticsearch-rest-client}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.httpasyncclient-4.1.2.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.netty-common-4.1.13.Final.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.netty-transport-4.1.13.Final.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.securesm-1.1.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.lucene-core-6.6.1.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.lucene-misc-6.6.1.jar}
2017.11.14 18:21:27 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2017.11.14 18:21:27 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.11.14 18:21:27 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
/opt/sonar/logs/es.log :
2017.11.14 18:21:24 INFO es[][o.e.n.Node] initializing ...
2017.11.14 18:21:24 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [5.7gb], net total_space [9.6gb], spins? [possibly], types [ext4]
2017.11.14 18:21:24 INFO es[][o.e.e.NodeEnvironment] heap size [503.6mb], compressed ordinary object pointers [true]
2017.11.14 18:21:24 INFO es[][o.e.n.Node] node name [sonarqube], node ID [3PxDbRbDQ4-M_YDsv25FHg]
2017.11.14 18:21:24 INFO es[][o.e.n.Node] version[5.6.3], pid[8661], build[1a2f265/2017-10-06T20:33:39.012Z], OS[Linux/4.4.0-22-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/9-internal/9-internal+0-2016-04-14-195246.b$
2017.11.14 18:21:24 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, $
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [aggs-matrix-stats]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [ingest-common]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [percolator]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] no plugins loaded
2017.11.14 18:21:27 ERROR es[][o.e.b.ElasticsearchUncaughtExceptionHandler] fatal error in thread [main], exiting
java.lang.ExceptionInInitializerError: null
at org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter$Builder.build(StemmerOverrideFilter.java:205) ~[lucene-analyzers-common-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:55$
at org.apache.lucene.analysis.nl.DutchAnalyzer.<init>(DutchAnalyzer.java:133) ~[lucene-analyzers-common-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:55:17]
at org.apache.lucene.analysis.nl.DutchAnalyzer.<init>(DutchAnalyzer.java:106) ~[lucene-analyzers-common-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:55:17]
at org.elasticsearch.indices.analysis.PreBuiltAnalyzers$20.create(PreBuiltAnalyzers.java:246) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.indices.analysis.PreBuiltAnalyzers.getAnalyzer(PreBuiltAnalyzers.java:487) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.index.analysis.AnalysisRegistry$PrebuiltAnalysis.<init>(AnalysisRegistry.java:407) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.index.analysis.AnalysisRegistry$PrebuiltAnalysis.<init>(AnalysisRegistry.java:392) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.index.analysis.AnalysisRegistry.<init>(AnalysisRegistry.java:62) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.indices.analysis.AnalysisModule.<init>(AnalysisModule.java:177) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:340) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:468) ~[?:?]
at java.security.AccessController.checkPermission(AccessController.java:894) ~[?:?]
at java.lang.SecurityManager.checkPermission(SecurityManager.java:541) ~[?:?]
at java.lang.Class.checkMemberAccess(Class.java:2584) ~[?:?]
at java.lang.Class.getDeclaredFields(Class.java:2092) ~[?:?]
at org.apache.lucene.util.RamUsageEstimator$1.run(RamUsageEstimator.java:339) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at org.apache.lucene.util.RamUsageEstimator$1.run(RamUsageEstimator.java:336) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at org.apache.lucene.util.RamUsageEstimator.shallowSizeOfInstance(RamUsageEstimator.java:336) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at org.apache.lucene.util.RamUsageEstimator.shallowSizeOf(RamUsageEstimator.java:313) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at org.apache.lucene.util.fst.ByteSequenceOutputs.<clinit>(ByteSequenceOutputs.java:154) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
... 21 more
java -version :
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
sonarqube version : 6.7
I launch sonarqube as root so there should not have problem coming from access right.
All the post that i find about this error where related with openjdk9 but this is not my case.
Do you have an idea of what is happening ?
SonarQube 6.7 includes an upgraded version of Elasticsearch which cannot be run as root. Thus, SonarQube can no longer be run as root.
The blog post you followed seems to recommend / assume that you're running as root. To not start SonarQube as root, simply end your su session, or log back in as yourself to start the process. Note that you'll need to make sure the user you are starting SonarQube as has 7 (read, write, execute) on the SonarQube directory, recursively, and 6 (read, write) on the log files if they already exist.
In my case, the Java version was the problem.
I installed Oracle JDK 8 for for sonarcube 6.7.1, which resolved the problem:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
You can read more about the supported platforms here. For now, only Java 8 is supported.
I got the following error in cmd:
INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up
and running INFO app[][o.e.p.PluginsService] no modules loaded INFO
app[][o.e.p.PluginsService] loaded plugin
[org.elasticsearch.transport.Netty4Plugin] WARN
app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value
[es]: 1 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped INFO
app[][o.s.a.SchedulerImpl] SonarQube is stopped
It had problems setting up Elasticsearch on its default port number 9001. (You can check it in the logs folder: .\sonarqube-7.6\logs)
I just changed the port number from 9001 to 0 in the sonarqube properties file.
Go to- .\sonarqube-7.6\conf\sonar.properties and set sonar.search.port=0
Port 0 takes any port which is unused.
Good luck with the changes

Resources