sonarq 6.6 for docker fails to start

1,667 views
Skip to first unread message

Dan Tran

unread,
Oct 21, 2017, 10:57:35 AM10/21/17
to SonarQube

Hi,

My latest sonarq + postgres 8.4 not able to start


2017.10.21 14:52:37 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.10.21 14:52:37 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es
2017.10.21 14:52:37 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.10.21 14:52:37 INFO  app[][o.e.p.PluginsService] no modules loaded
2017.10.21 14:52:37 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2017.10.21 14:52:39 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2017.10.21 14:52:39 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.10.21 14:52:39 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped


thoughts?

-D

G. Ann Campbell

unread,
Oct 21, 2017, 12:54:30 PM10/21/17
to SonarQube
Hi D,

Anything interesting in $SONARQUBE_HOME/logs/es.log?


Ann

Dan Tran

unread,
Oct 22, 2017, 1:00:29 AM10/22/17
to SonarQube
Unfortunately, I am not able to get into the dead container to checkout the logs dir
 
Any suggestion how to get the logs?


-D

Eric Hartmann

unread,
Oct 22, 2017, 1:41:57 AM10/22/17
to Dan Tran, SonarQube
Hi Dan,

Can you provide your DockerFile in order to understand what's happening ?

Cheers,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/f43cb3d7-b71e-4f95-8d09-26a4a31ba2a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Eric HARTMANN | SonarSource

Dan Tran

unread,
Oct 22, 2017, 2:37:20 AM10/22/17
to SonarQube

I just found it fails out of the box. as simple as that

docker run -it sonarqube

Unable to find image 'sonarqube:latest' locally
latest: Pulling from library/sonarqube
3e17c6eae66c: Already exists
74d44b20f851: Already exists
a156217f3fa4: Already exists
4a1ed13b6faa: Already exists
77980e5d0a6d: Already exists
5458607a81d3: Already exists
e34cf8338f42: Already exists
2f3d3da5c56e: Already exists
2ade7a861e3f: Already exists
878b808920dd: Pull complete
3526affb7d62: Pull complete
Digest: sha256:581704a19c859ae794af889d8c28202ced762b08ebea820c4f6aa913b3242241
Status: Downloaded newer image for sonarqube:latest
2017.10.22 06:35:49 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2017.10.22 06:35:49 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.10.22 06:35:49 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es
2017.10.22 06:35:49 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.10.22 06:35:50 INFO  app[][o.e.p.PluginsService] no modules loaded
2017.10.22 06:35:50 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2017.10.22 06:35:51 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2017.10.22 06:35:51 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.10.22 06:35:51 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

Jolkdarr _

unread,
Oct 22, 2017, 5:40:10 AM10/22/17
to SonarQube
Hello

I downloaded and unzip sonarqube-6.6.zip on linux (Ubuntu 16.04 LTS).
Elasticsearch won't run
=> script elasticsearch/bin/elasticsearch patched (exec replaced with 'sudo -u nobody').
Elasticsearch run but exception raised (Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender)
=> I gived up and went back to Sonarqube 6.5, waiting a package "easier" to upgrade :(

Regards.

Linda

unread,
Oct 23, 2017, 2:40:06 AM10/23/17
to SonarQube
Same issue here. 
05:46:09.901 [main] WARN org.sonar.application.config.AppSettingsLoaderImpl - Configuration file not found: /opt/sonarqube/conf/sonar.properties
2017.10.23 05:46:10 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2017.10.23 05:46:10 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.10.23 05:46:10 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es
2017.10.23 05:46:10 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.10.23 05:46:10 INFO  app[][o.e.p.PluginsService] no modules loaded
2017.10.23 05:46:10 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2017.10.23 05:46:11 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2017.10.23 05:46:11 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.10.23 05:46:11 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

Linda

unread,
Oct 23, 2017, 3:44:46 AM10/23/17
to SonarQube
Check the es.log, here is the exceptions: 
2017.10.23 07:27:30 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.2.jar:5.6.2]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.2.jar:5.6.2]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.2.jar:5.6.2]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.2.jar:5.6.2]
        ... 6 more

Linda

unread,
Oct 23, 2017, 5:01:06 AM10/23/17
to SonarQube

I start the sonarqube6.6 use this command 

docker run -d --restart always --name sonarqube6.6 -p 19001:9000 -e SONARQUBE_JDBC_USERNAME=${user} -e SONARQUBE_JDBC_PASSWORD=${pwd} -e SONARQUBE_JDBC_URL="jdbc:mysql://productivity.cz7savcjxymi.ap-southeast-1.rds.amazonaws.com:3306/sonarqube6.6?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" sonarqube:6.6

Seems the docker is somehow  running elasticsearch as root. But I don't know how to run as another user.  

Same issue here. 
2017.10.<span sty

nicolas...@sonarsource.com

unread,
Oct 23, 2017, 5:36:34 AM10/23/17
to SonarQube
Hi @all,

Looks like this is being looked into:
Looks like work in progress.

Best regards,
Nicolas

johan...@gmail.com

unread,
Oct 23, 2017, 5:53:09 AM10/23/17
to SonarQube
Exactly same issue here. Thanks Linda for indirectly helping me to pinpoint it ;)

$cat es.log
2017.10.23 09:49:47 ERROR es[][o.e.b.Bootstrap] Exception

java.lang.RuntimeException: can not run elasticsearch as root



Op maandag 23 oktober 2017 09:44:46 UTC+2 schreef Linda:

Daniel Schwarz

unread,
Oct 24, 2017, 2:25:01 AM10/24/17
to johan...@gmail.com, SonarQube
Hi,

if your question is also related to docker, then please give it another try. The issue https://github.com/SonarSource/docker-sonarqube/issues/116 was resolved yesterday evening and now the docker sonarqube image from the official repository works fine for me.

If your question is not related to docker, please make sure, that you do not run SonarQube as root user. Create a dedicated user with more restrictive permissions and run SonarQube as that user.

Cheers
Daniel


For more options, visit https://groups.google.com/d/optout.
--

Daniel Schwarz | SonarSource

Developer

https://sonarsource.com

Dan Tran

unread,
Oct 24, 2017, 3:38:01 AM10/24/17
to SonarQube
it works now.

Thanks


cph...@gmail.com

unread,
Oct 27, 2017, 10:38:16 AM10/27/17
to SonarQube
Can anyone help how to get resolved on "java.lang.RuntimeException: can not run elasticsearch as root"
Had created and given special privileges to the user, still facing with same error.

Thanks in Advance............


meyy...@linkstreet.in

unread,
Nov 8, 2017, 12:20:50 AM11/8/17
to SonarQube
Thanks @Daniel Schwarz. I create a dedicated user with more restrictive permissions and ran SonarQube. It works now.

Thanks and Regards,
Meyyappan
Reply all
Reply to author
Forward
0 new messages