Hi,
We have a CentOS server running Docker that we are trying to run SonarQube on. When I run the container, it starts up but then hangs after 'HTTP Connector enabled on port 9000'. If I navigate to the url in a browser I just get a TomCat error page.
Is SonarQube container supported on CentOS? Any suggestions on debugging steps?
Thanks.
20:40:01.035 [main] WARN org.sonar.application.config.AppSettingsLoaderImpl - Configuration file not found: /opt/sonarqube/conf/sonar.properties
2017.11.28 20:40:01 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2017.11.28 20:40:01 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.11.28 20:40:01 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.11.28 20:40:01 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.11.28 20:40:01 INFO app[][o.e.p.PluginsService] no modules loaded
2017.11.28 20:40:01 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2017.11.28 20:40:09 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2017.11.28 20:40:09 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.1.1.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process372844261423375785properties
2017.11.28 20:40:10 INFO web[][o.s.p.ProcessEntryPoint] Starting web
2017.11.28 20:40:10 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2017.11.28 20:40:10 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2017.11.28 20:43:52 INFO app[][o.s.a.SchedulerImpl] Stopping SonarQube
2017.11.28 20:43:52 INFO web[][o.s.p.StopWatcher] Stopping process
2017.11.28 20:43:52 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2017.11.28 20:43:52 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.11.28 20:43:52 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2017.11.28 20:43:52 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
20:43:58.618 [main] WARN org.sonar.application.config.AppSettingsLoaderImpl - Configuration file not found: /opt/sonarqube/conf/sonar.properties
2017.11.28 20:43:58 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2017.11.28 20:43:58 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.11.28 20:43:58 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.11.28 20:43:58 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.11.28 20:43:59 INFO app[][o.e.p.PluginsService] no modules loaded
2017.11.28 20:43:59 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2017.11.28 20:44:07 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2017.11.28 20:44:07 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.1.1.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process5202420815524590070properties
2017.11.28 20:44:08 INFO web[][o.s.p.ProcessEntryPoint] Starting web
2017.11.28 20:44:08 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2017.11.28 20:44:09 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
Could you post your docker-compose file or docker run command?
CentOS Version: CentOS Linux release 7.2.1511 (Core)
Docker Version: Docker version 17.09.0-ce, build afdb6d4
sonarqube:
image: sonarqube:6.7
container_name: sonarqube
environment:
#- VIRTUAL_HOST=sonar.example.com
#- VIRTUAL_PORT=9000
- SONARQUBE_JDBC_URL=jdbc:postgresql://sonarqube_db_1:5432/sonar
ports:
- "9000:9000"
links:
- sonarqube_db_1
volumes:
- /var/lib/docker/app/sonarqube/conf:/opt/sonarqube/conf
- /var/lib/docker/app/sonarqube/data:/opt/sonarqube/data
- /var/lib/docker/app/sonarqube/extensions:/opt/sonarqube/extensions
- /var/lib/docker/app/sonarqube/bundled-plugins:/opt/sonarqube/lib/bundled-plugins
- /var/lib/docker/app/sonarqube/temp:/opt/sonarqube/temp
- /var/lib/docker/app/sonarqube/web:/opt/sonarqube/web
sonarqube_db_1:
image: postgres
container_name: sonarqube_db_1
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
volumes:
- /var/lib/docker/app/sonarqube/postgresql/data/:/var/lib/postgresql/data
- /var/lib/docker/app/sonarqube/postgresql_data/:/var/lib/postgresqldata
Why did you add this binding?
- /var/lib/docker/app/sonarqube/web:/opt/sonarqube/web
I don't recall the original reason for adding that binding, but I just commented it out and tried to restart it and get the following error:
docker-compose up
Starting sonarqube_db_1 ...
Starting sonarqube_db_1 ... done
Recreating sonarqube ...
Recreating sonarqube ... done
Attaching to sonarqube_db_1, sonarqube
sonarqube_db_1 | 2017-12-15 19:04:39.946 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
sonarqube_db_1 | 2017-12-15 19:04:39.946 UTC [1] LOG: listening on IPv6 address "::", port 5432
sonarqube_db_1 | 2017-12-15 19:04:39.949 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
sonarqube_db_1 | 2017-12-15 19:04:39.963 UTC [20] LOG: database system was shut down at 2017-12-15 19:04:32 UTC
sonarqube_db_1 | 2017-12-15 19:04:39.969 UTC [1] LOG: database system is ready to accept connections
sonarqube | 19:04:40.508 [main] WARN org.sonar.application.config.AppSettingsLoaderImpl - Configuration file not found: /opt/sonarqube/conf/sonar.properties
sonarqube | 2017.12.15 19:04:40 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
sonarqube | 2017.12.15 19:04:40 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
sonarqube | 2017.12.15 19:04:40 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
sonarqube | 2017.12.15 19:04:40 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
sonarqube | 2017.12.15 19:04:41 INFO app[][o.e.p.PluginsService] no modules loaded
sonarqube | 2017.12.15 19:04:41 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
sonarqube | 2017.12.15 19:04:49 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
sonarqube | 2017.12.15 19:04:49 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.1.1.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process5622385661421284851properties
sonarqube | 2017.12.15 19:04:49 INFO web[][o.s.p.ProcessEntryPoint] Starting web
sonarqube | 2017.12.15 19:04:49 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
sonarqube | 2017.12.15 19:04:50 INFO web[][o.e.p.PluginsService] no modules loaded
sonarqube | 2017.12.15 19:04:50 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
sonarqube | 2017.12.15 19:04:50 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
sonarqube | 2017.12.15 19:04:50 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
sonarqube | 2017.12.15 19:04:50 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
sonarqube | 2017.12.15 19:04:51 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
sonarqube | 2017.12.15 19:04:51 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 6.7.0.33306 / 5d031d9d2ac3f69b4b9bc600d50563b1886c7d8b
sonarqube | 2017.12.15 19:04:51 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonarqube_db_1:5432/sonar
sonarqube | 2017.12.15 19:04:52 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
sonarqube | 2017.12.15 19:04:52 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
sonarqube | 2017.12.15 19:04:52 ERROR web[][o.s.s.p.Platform] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.
sonarqube | 2017.12.15 19:04:54 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
sonarqube | 2017.12.15 19:04:55 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
sonarqube | 2017.12.15 19:04:55 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
sonarqube | 2017.12.15 19:04:55 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
sonarqube exited with code 0
@davidlaughlin notice that your last log contains following error message:
sonarqube | 2017.12.15 19:04:52 ERROR web[][o.s.s.p.Platform] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.
which usually means that you're trying to run newer version of SonarQube with database that was used by older version and there is no direct migration step (ref https://stackoverflow.com/questions/34947417/messageexception-current-version-is-too-old-please-upgrade-to-long-term-suppor).
But I guess that in your case you've started from a fresh database,
and it reached some inconsistent state because of previous failed attempts,
in this case advice will be - now that you've removed suspicious binding, start from a fresh database again.
Yep. Just wiped the data volumes and everything came up fine. Thanks for the assistance.
Most helpful comment
Why did you add this binding?
- /var/lib/docker/app/sonarqube/web:/opt/sonarqube/web