Hi ,
I am running into an error while trying to start/run the docker container using sonarqube:lts-alpine image. On docker restart the issue gets resolved !
Not sure if I am missing something in the first run , or if its an image issue.
Env :
Docker version 18.06.0-ce, build 0ffa825
docker-compose version 1.22.0, build f46880f
Running the image :
bash
docker run -it -p 9000:9000 --name=sonar-lts sonarqube:lts-alpine
Error logs :
2018.08.01 07:51:41 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.08.01 07:51:41 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.01 07:51:41 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
2018.08.01 07:51:41 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.08.01 07:51:42 INFO app[][o.e.p.PluginsService] no modules loaded
2018.08.01 07:51:42 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.01 07:51:49 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.01 07:51:49 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/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/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process8768677565401733129properties
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils
at org.sonar.process.ConfigurationUtils.loadPropsFromCommandLineArgs(ConfigurationUtils.java:68)
at org.sonar.process.ProcessEntryPoint.createForArguments(ProcessEntryPoint.java:189)
at org.sonar.server.app.WebServer.main(WebServer.java:87)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
2018.08.01 07:51:49 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [web]: 1
2018.08.01 07:51:49 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.08.01 07:51:49 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.08.01 07:51:49 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
2018.08.01 07:51:49 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
The same happens for another tag 7.1-alpine (have not rest of the tags), however the error thrown is a different one
Error logs for sonarqube:7.1-alpine
````
2018.08.01 07:59:13 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.08.01 07:59:13 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.01 07:59:13 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
2018.08.01 07:59:13 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.08.01 07:59:13 INFO app[][o.e.p.PluginsService] no modules loaded
2018.08.01 07:59:13 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.01 07:59:20 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.01 07:59:20 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/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/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process2762129596018060080properties
Error: Could not find or load main class org.sonar.server.app.WebServer
2018.08.01 07:59:20 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [web]: 1
2018.08.01 07:59:20 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.08.01 07:59:20 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
2018.08.01 07:59:20 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.08.01 07:59:20 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
```
In both cases the application started running on adocker restart` command . I tested this use case several times before reporting it here .
NOTE : I tested this as root user and non-root user for docker (hope that is no way related to the issue) . The only way its working right now is by using a restart policy
yaml
sonarqube:
image: 'sonarqube:lts-alpine'
restart: always
ports:
- "9000:9000"
But on Kubernetes , the application does not start even on a restartPolicy: Always restart policy. The same error repeats thus pushing the pod into CrashLoopBackOff state.
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: sonarqube
labels:
app: sonarqube
spec:
replicas: 1
selector:
matchLabels:
app: sonarqube
template:
metadata:
labels:
app: sonarqube
env: test
track: stable
spec:
containers:
- name: sonarqube
image: "sonarqube:lts-alpine"
resources:
requests:
memory: "1Gi"
cpu: "250m"
ports:
- name: application
containerPort: 9000
Pod status :
NAME READY STATUS RESTARTS AGE
sonarqube-778977fb5d-vhlkn 0/1 CrashLoopBackOff 7 18m
Pod Logs :
text
2018.08.01 09:11:20 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.08.01 09:11:20 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.01 09:11:20 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
2018.08.01 09:11:20 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.08.01 09:11:21 INFO app[][o.e.p.PluginsService] no modules loaded
2018.08.01 09:11:21 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.01 09:11:35 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.01 09:11:35 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/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/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process5358117380166623704properties
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableSet
at org.sonar.server.app.ServerProcessLogging.<clinit>(ServerProcessLogging.java:40)
at org.sonar.server.app.WebServer.main(WebServer.java:89)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableSet
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
2018.08.01 09:11:36 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [web]: 1
2018.08.01 09:11:36 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.08.01 09:11:36 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.08.01 09:11:36 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.08.01 09:11:36 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
Thanks in advance.
Regards,
Bhavya.
I have reproduced the same issue when trying to run sonarqube alpine docker image into a docker swarm environment (I use the sonarqube:7.1-alpine image). The deploy fails 4 times and stops. If a restart manually one of the stopped containers, sonarqube starts (but the service stills have a complete status and not a running status).
Stack status:
docker service ps sonarqube-dev_sonarqube
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
xxtxxf2sld4g sonarqube-dev_sonarqube.1 sonarqube:7.1-alpine localhost.localdomain Shutdown Complete about a minute ago
mpe6mmt7ao67 \_ sonarqube-dev_sonarqube.1 sonarqube:7.1-alpine localhost.localdomain Shutdown Complete about a minute ago
umiuoyvwib6l \_ sonarqube-dev_sonarqube.1 sonarqube:7.1-alpine localhost.localdomain Shutdown Complete about a minute ago
ndd3lkergc9d \_ sonarqube-dev_sonarqube.1 sonarqube:7.1-alpine localhost.localdomain Shutdown Complete 2 minutes ago
docker ps -a | grep sonarqube
158014448c8b sonarqube:7.1-alpine "./bin/run.sh" 2 minutes ago Exited (0) About a minute ago sonarqube-dev_sonarqube.1.xxtxxf2sld4gfxtgmwiyqe9tm
bfd4cd5b51f8 sonarqube:7.1-alpine "./bin/run.sh" 2 minutes ago Exited (0) 2 minutes ago sonarqube-dev_sonarqube.1.mpe6mmt7ao67eta00pvznv64x
88dab25ea855 sonarqube:7.1-alpine "./bin/run.sh" 2 minutes ago Exited (0) 2 minutes ago sonarqube-dev_sonarqube.1.umiuoyvwib6linv67sto5seyl
55eb9b21d375 sonarqube:7.1-alpine "./bin/run.sh" 3 minutes ago Exited (0) 2 minutes ago sonarqube-dev_sonarqube.1.ndd3lkergc9dynpc8qng7xf9q
Logs of the sonarqube container launched by docker stack deploy command:
docker logs 55eb9b21d375
2018.08.03 13:50:55 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.08.03 13:50:55 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.03 13:50:55 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
2018.08.03 13:50:55 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.08.03 13:50:56 INFO app[][o.e.p.PluginsService] no modules loaded
2018.08.03 13:50:56 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.03 13:51:16 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.03 13:51:16 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/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/*:/opt/sonarqube/lib/jdbc/mysql/mysql-connector-java-5.1.42.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process3968325537016381781properties
Error: Could not find or load main class org.sonar.server.app.WebServer
2018.08.03 13:51:16 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [web]: 1
2018.08.03 13:51:16 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.08.03 13:51:16 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
2018.08.03 13:51:16 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.08.03 13:51:16 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
Then if I restart manually one of the stopped containers; the logs looks fine and the app is alive:
docker logs 158014448c8b
2018.08.03 13:52:10 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.08.03 13:52:11 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.03 13:52:11 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
2018.08.03 13:52:11 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.08.03 13:52:11 INFO app[][o.e.p.PluginsService] no modules loaded
2018.08.03 13:52:11 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.03 13:52:21 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.03 13:52:21 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/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/*:/opt/sonarqube/lib/jdbc/mysql/mysql-connector-java-5.1.42.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process8395129689095672828properties
Error: Could not find or load main class org.sonar.server.app.WebServer
2018.08.03 13:52:21 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [web]: 1
2018.08.03 13:52:21 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.08.03 13:52:22 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.08.03 13:52:22 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.08.03 13:52:22 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
2018.08.03 13:57:06 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.08.03 13:57:06 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.03 13:57:06 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
2018.08.03 13:57:06 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.08.03 13:57:07 INFO app[][o.e.p.PluginsService] no modules loaded
2018.08.03 13:57:07 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.03 13:57:19 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.03 13:57:19 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/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/*:/opt/sonarqube/lib/jdbc/mysql/mysql-connector-java-5.1.42.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process5275297022215672923properties
2018.08.03 13:57:19 INFO web[][o.s.p.ProcessEntryPoint] Starting web
2018.08.03 13:57:20 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2018.08.03 13:57:21 INFO web[][o.e.p.PluginsService] no modules loaded
2018.08.03 13:57:21 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2018.08.03 13:57:21 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2018.08.03 13:57:21 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.03 13:57:22 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2018.08.03 13:57:22 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 7.1.0.11001 / 9f47ce9daecebb16fc777249a418252625ae774a
2018.08.03 13:57:22 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:mysql://mysql:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2018.08.03 13:57:24 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Flex / 2.3 / 79167f762219bea1fd181ff5ef6ca4b34abd1675
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarC# / 6.5.0.3766 / 6011a1e9fb002edb044ae3092d92bcfb7d9d8a2d
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 3.2.0.5506 / 86da09565f891121df248835665f5d8ed98772b6
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava / 4.15.0.12310 / 572454b93016ec73a53fe0e07b2ffdc356d21ba9
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP / 2.11.0.2485 / 741861a29e5f9a26c6c99c06268facb6c4f4a882
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython / 1.8.0.1496 / 3fe3bc4d0273a5721ea2fb368dc45b1bb82fede3
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: Git / 1.3.0.869 / 4da53e3f9e55f4f2e5796625cb0c5768ed152079
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: SVN / 1.6.0.860 / 2111fdbd1dddda4ad6d4ed6486fd0b18c1010d3b
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 1.1.0.1079 / 042c9e65239a47d92d305f9767f730b3cc1e5ed3
2018.08.03 13:57:24 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML / 1.4.3.1027 / 39588245cecf538bb27be4e496ff303b0143d20b
2018.08.03 13:57:25 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@2d1f4bb4 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/properties*, ...]}]
2018.08.03 13:57:25 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2018.08.03 13:57:26 INFO web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
2018.08.03 13:57:27 INFO web[][o.s.s.s.LogServerId] Server ID: AWT1oPwxVwM3t8vmb8rz
2018.08.03 13:57:27 INFO web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.
2018.08.03 13:57:27 INFO web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.)
2018.08.03 13:57:27 INFO web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index
2018.08.03 13:57:27 INFO web[][o.s.s.s.RegisterPlugins] Register plugins
2018.08.03 13:57:27 INFO web[][o.s.s.s.RegisterMetrics] Register metrics
2018.08.03 13:57:28 INFO web[][o.s.s.r.RegisterRules] Register rules
2018.08.03 13:57:31 INFO web[][o.s.s.q.BuiltInQProfileRepositoryImpl] Load quality profiles
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Register quality profiles
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile cs/Sonar way
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile java/Sonar way
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile xml/Sonar way
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile flex/Sonar way
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile js/Sonar way Recommended
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile js/Sonar way
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile php/Sonar way
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile php/PSR-2
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile php/Drupal
2018.08.03 13:57:31 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile py/Sonar way
2018.08.03 13:57:32 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile ts/Sonar way
2018.08.03 13:57:32 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile ts/Sonar way recommended
2018.08.03 13:57:32 INFO web[][o.s.s.s.RegisterPermissionTemplates] Register permission templates
2018.08.03 13:57:32 INFO web[][o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@7858d2fa [pattern=UrlPattern{inclusions=[/api/issues/delete_comment.*, ...], exclusions=[/api/properties*, ...]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.DeprecatedPropertiesWsFilter@7318857e [pattern=UrlPattern{inclusions=[/api/properties/*], exclusions=[]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceReroutingFilter@6270f8f0 [pattern=UrlPattern{inclusions=[/api/components/bulk_update_key, ...], exclusions=[]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@3fdb05a6 [pattern=UrlPattern{inclusions=[/sessions/init/*], exclusions=[]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@78517e [pattern=UrlPattern{inclusions=[/oauth2/callback/*], exclusions=[]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LoginAction@17787740 [pattern=UrlPattern{inclusions=[/api/authentication/login], exclusions=[]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LogoutAction@644091f7 [pattern=UrlPattern{inclusions=[/api/authentication/logout], exclusions=[]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.ValidateAction@d54d6e4 [pattern=UrlPattern{inclusions=[/api/authentication/validate], exclusions=[]}]
2018.08.03 13:57:32 INFO web[][o.s.s.p.Platform] WebServer is operational
2018.08.03 13:57:32 INFO app[][o.s.a.SchedulerImpl] Process[web] is up
2018.08.03 13:57:32 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='ce', ipcIndex=3, logFilenamePrefix=ce]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:/opt/sonarqube/lib/jdbc/mysql/mysql-connector-java-5.1.42.jar org.sonar.ce.app.CeServer /opt/sonarqube/temp/sq-process866069164205681226properties
2018.08.03 13:57:33 INFO ce[][o.s.p.ProcessEntryPoint] Starting ce
2018.08.03 13:57:33 INFO ce[][o.s.ce.app.CeServer] Compute Engine starting up...
2018.08.03 13:57:34 INFO ce[][o.e.p.PluginsService] no modules loaded
2018.08.03 13:57:34 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2018.08.03 13:57:34 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2018.08.03 13:57:34 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.03 13:57:35 INFO ce[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2018.08.03 13:57:35 INFO ce[][o.sonar.db.Database] Create JDBC data source for jdbc:mysql://mysql:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
2018.08.03 13:57:37 INFO ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2018.08.03 13:57:37 INFO ce[][o.s.c.c.CePluginRepository] Load plugins
2018.08.03 13:57:38 INFO ce[][o.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before 1517752658495
2018.08.03 13:57:38 INFO ce[][o.s.c.q.PurgeCeActivities] Delete the Scanner contexts tasks created before 1530885458504
2018.08.03 13:57:38 INFO ce[][o.s.ce.app.CeServer] Compute Engine is operational
2018.08.03 13:57:38 INFO app[][o.s.a.SchedulerImpl] Process[ce] is up
2018.08.03 13:57:38 INFO app[][o.s.a.SchedulerImpl] SonarQube is up
I dunno what's block the start of the apps at first launch, but it's an annoying situation.
Hope this will help.
Chris
For anyone trying to run SonarQube in Kubernetes and get this error:
Error: Could not find or load main class org.sonar.server.app.WebServer
2018.09.04 08:37:36 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [web]: 1
2018.09.04 08:37:36 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.09.04 08:37:36 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
2018.09.04 08:37:36 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.09.04 08:37:36 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
Just switch to the non alpine image.
I faced the same issue and I the behaviour is exactly the same as reported here (the failure is specific to the first launch and restarting the container resolves the issue).
I've not identified the root cause for this behaviour, I'm trying to. BTW, non-alpine base image works, but, it isn't ideal if you want to keep your images light.
See the linked issue for a workaround that seems to work.
We included the workaround in our unofficial and unsupported images 7.4-community-alpine and 6.7.6-community-alpine.
We don't officially support these images (they won't be listed on the hub), because OpenJDK on Alpine is not officially supported, hence the quirky issues. Build on these images at your own risk.
Most helpful comment
For anyone trying to run SonarQube in Kubernetes and get this error:
Just switch to the non alpine image.