Skip to content

Strange crash of sonarqube builds running on top of openjdk:8-alpine on Linux #250

Closed
@ghost

Description

I'm puzzled by crashes at runtime of SonarQube built on top of openjdk:8-alpine, on Linux hosts.

Relevant log from the crash of SonarQube 6.7.5-alpine:

2018.11.23 14:20:27 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-process6376838719374991114properties
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/Context
	at org.sonar.server.app.WebServer.main(WebServer.java:89)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.Context
	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)
	... 1 more

Relevant log from the crash of SonarQube 6.7.6-community-alpine, same as from 7.4-community-alpine:

2018.11.23 10:56:06 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-process8139424421906286412properties
Error: Could not find or load main class org.sonar.server.app.WebServer

I run the built images with the simplest possible command, docker run imagename.

If I do the same on OSX, it works, I only get the above errors on Linux.

I see others have similar issues, strangely on first run only. For example if I run docker run -it imagename bash, and then within the container /opt/sonarqube/bin/run.sh, the first run fails and the 2nd and subsequent runs work fine.

What's going on?

  • How can it work on OSX but not on Linux hosts?
  • How can it work for 2nd+ runs but not for the first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions