Docker-sonarqube: Container image 7.7-community crashes with stable Helm Chart

Created on 27 May 2019  Â·  6Comments  Â·  Source: SonarSource/docker-sonarqube

Hi,

I've a problem with the installation of sonarqube with the stable Helm Charts on Kubernetes/Openshift 3.10.
But I guess I can reduce it to the current container image of 7.7-community

So that's what's going on:

$ oc new-project sonar-test
$ oc adm policy add-scc-to-group anyuid system:serviceaccounts:sonar-test

$ helm install stable/sonarqube --name sonar-test --namespace sonar-test
...
$ oc get pods
$ oc get pods
NAME                                     READY     STATUS             RESTARTS   AGE
sonar-test-postgresql-5bc65849b6-brlc9   1/1       Running            0          1m
sonar-test-sonarqube-c5767dd99-w6hrs     0/1       CrashLoopBackOff   3          1m

$ oc logs -f sonar-test-sonarqube-c5767dd99-w6hrs
./bin/run.sh: line 24: exec: java: not found

Luckily I've found a 2 weeks old image tag:

$ helm install stable/sonarqube --name sonar-test-2 --namespace sonar-test \
  --set image.repository='docker.io/sonarqube@sha256' \
  --set image.tag='9301ab5fbb93c624fa2e96c2c47287d0beef11729e99b2804e501c831a90447e' \
  --set image.pullPolicy='Always'

$ oc get pods
NAME                                       READY     STATUS             RESTARTS   AGE
sonar-test-2-postgresql-7975b797f8-29jsw   1/1       Running            0          2m
sonar-test-2-sonarqube-797bd68bd8-hkmdp    1/1       Running            1          2m
sonar-test-postgresql-5bc65849b6-brlc9     1/1       Running            0          5m
sonar-test-sonarqube-c5767dd99-w6hrs       0/1       CrashLoopBackOff   5          5m

Maybe someone has encountered the same issues or has some clue?
It seems the Dockerfile of the 7.7-community image hasn't changed for a couple of weeks, but it seems the image is build this weekend (25/05).
So maybe there's a problem with the java base image?
But it seems to be ok:

$ docker run -it sonarqube:7.7-community sh
$ which java
/usr/local/openjdk-8/bin/java
$ echo $PATH 
/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

Thanks Markus

Most helpful comment

and I missed it, there's a PR already

https://github.com/helm/charts/pull/14141

All 6 comments

same issue here.

Okay I modified the deployment

    spec:
      containers:
      - args:
        - /bin/bash
        - -c
        - while (true); do sleep 10; done

and removed the probes.

This let me debug directly inside of k8s

$ kubectl exec -it sonarqube-sonarqube-59d4d9fb77-2cf6b /bin/bash
sonarqube@sonarqube-sonarqube-59d4d9fb77-2cf6b:/opt/sonarqube$ which java
sonarqube@sonarqube-sonarqube-59d4d9fb77-2cf6b:/opt/sonarqube$ echo $PATH | tr ':' '\n'
/usr/local/openjdk-8/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
sonarqube@sonarqube-sonarqube-59d4d9fb77-2cf6b:/opt/sonarqube$ find / -name java
find: ‘/proc/tty/driver’: Permission denied
find: ‘/var/cache/apt/archives/partial’: Permission denied
find: ‘/var/cache/ldconfig’: Permission denied
find: ‘/etc/ssl/private’: Permission denied
find: ‘/root’: Permission denied

Looks liked the configmap is overriding things.

sonarqube@sonarqube-sonarqube-59d4d9fb77-2cf6b:/opt/sonarqube$ ls -l /usr/local/
total 0
lrwxrwxrwx 1 root root 22 May 28 05:19 copy_plugins.sh -> ..data/copy_plugins.sh

Not a docker issue.

and I missed it, there's a PR already

https://github.com/helm/charts/pull/14141

Cool! Thanks for the investigations.

Thanks

Was this page helpful?
0 / 5 - 0 ratings