Can't runt SonarQube in docker

192 views
Skip to first unread message

mi...@marinescu.dk

unread,
Nov 30, 2017, 9:18:44 AM11/30/17
to SonarQube
Hi,
I am trying to run sonarqube in docker without success.

I have created a network like this :

docker network create sonarqube-network

I am creating mysql server like this :

docker run \
-e "MYSQL_DATABASE=sonarqube" \
-e "MYSQL_USER=sonarqube" \
-e "MYSQL_PASSWORD=sonarqube" \
--name=mysql_server \
--mount type=bind,src=/Users/myUser/docker/mysql/my.cnf,dst=/etc/my.cnf \
--mount type=bind,src=/Users/myUser/docker/mysql/data,dst=/var/lib/mysql \
--network=sonarqube-network -d mysql/mysql-server:5.7 \
--character-set-server=utf8 --collation-server=utf8_general_ci


I am creating sonarqube server like this :

docker run \                                                                                      
-p 9002:9000 -p 9093:9092 \    
-e SONARQUBE_JDBC_USERNAME=sonarqube \
-e SONARQUBE_JDBC_PASSWORD=sonarqube \
-e SONARQUBE_JDBC_URL="jdbc:mysql://mysql_server:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true" \
--name=sonarqube1 \                                                        
--network=sonarqube-network -d sonarqube

Here is the log when sonarqube starts first time : https://gist.github.com/donnib/a89e0c4a85dc12e1af0138e290abac3e
Here is the log when sonarqube is started second time : https://gist.github.com/donnib/27c382b5b4b90cd399006a7c94c7cb6f

The problem is that sonarqube stops without saying anything first time and second time it says : None of the configured nodes are available

The sonarqube image is on c1637bd4502f meaning on 6.7
Above is run on docker 17.09.0 on Mac High Sierra.

Any ideas what might be the problem ?


G. Ann Campbell

unread,
Nov 30, 2017, 9:29:30 AM11/30/17
to SonarQube
Hi,

There are several different logs in a SonarQube instance. If you check the others, you'll likely find the problem.

Off hand, though, I'm going to guess you try to run SonarQube as root? As of 6.7 (6.6?), that no longer works because of an upgrade we did to ElasticSearch.


Ann

donnib

unread,
Nov 30, 2017, 9:31:52 AM11/30/17
to SonarQube
Which logs are you referring to ? 

The launch of sonarqube is done in the docker container and i don't know how that is done, i am using the official image https://hub.docker.com/_/sonarqube/

G. Ann Campbell

unread,
Nov 30, 2017, 10:56:39 AM11/30/17
to SonarQube
Hi,

Check the contents of $SONARQUBE_HOME/logs. 


Ann

G. Ann Campbell

unread,
Nov 30, 2017, 11:18:26 AM11/30/17
to SonarQube
Hi,

Actually line 11 of your first log seems to indicate that you're running out of memory. I'm told that when this happens, the most memory-aggressive process is arbitrarily killed.


Ann
Message has been deleted

mi...@marinescu.dk

unread,
Dec 1, 2017, 4:08:48 AM12/1/17
to SonarQube
Indeed that was the case. Even though it seemed i had memory docker did not have allocated memory, raising the bar for docker solved the problem. Thank you.

G. Ann Campbell

unread,
Dec 1, 2017, 6:01:51 AM12/1/17
to mi...@marinescu.dk, SonarQube
Hi,

Thanks for following up.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/AOfNU4pPWcE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/27196435-4bcd-460e-9978-65ef4d415669%40googlegroups.com.

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

Reply all
Reply to author
Forward
0 new messages