SonarQube image in OpenShift

Hi,
i am trying to use the latest sonarqube image (7.9-community) on openshift.
i saw a similar issues #254 (https://github.com/SonarSource/docker-sonarqube/issues/254) with similar problem (tried optional solutions in #254)
bottom line, after OpenShift pulling the image the pod seem to crush after few seconds with this log:

tail: cannot open ‘./logs/es.log’ for reading: No such file or directory
2019.09.08 06:53:26 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2019.09.08 06:53:26 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.09.08 06:53:27 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2019.09.08 06:53:27 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.09.08 06:53:27 INFO app[o.e.p.PluginsService] no modules loaded
2019.09.08 06:53:27 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.09.08 06:53:28 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.09.08 06:53:28 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2019.09.08 06:53:28 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped

I don’t think it’s a permission issue (using the tips from issue #254) and i don’t think it’s something with the ElasticSearch memory because don’t have any limitation here.
i know that you don’t support openshift but i saw here that users in the community using sonarqube on openshift successfully.

I’m having trouble getting mine to work.

Much appreciated help!

1 Like

I do have similar issues, but managed to successfully deploy the latest sonarqube 7.9 on OpenShift platform, but the biggest challenge I have is the redeployment fails with below error. Looks like issues with Elastic Search indexes. Not stable on OpenShift due to Elastic Search, if you delete /opt/sonarqube/data/es6 folder and redeploy this works sometimes.

If you have downloaded and installed any other additional plugins on top of this, those will be retained (only if it is persistent jenkins instance)2019.09.25 12:25:08 ERROR web[o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.IllegalStateException: Fail to execute ES index request for key ‘projectmeasures.auth.projectmeasure.initialized’ on index ‘metadatas’ on type ‘metadata’
at org.sonar.server.es.request.ProxyIndexRequestBuilder.get(ProxyIndexRequestBuilder.java:43)
at org.sonar.server.es.request.ProxyIndexRequestBuilder.get(ProxyIndexRequestBuilder.java:31)
at org.sonar.server.es.metadata.MetadataIndexImpl.setMetadata(MetadataIndexImpl.java:108)
at org.sonar.server.es.metadata.MetadataIndexImpl.setInitialized(MetadataIndexImpl.java:66)
at org.sonar.server.es.IndexerStartupTask.setInitialized(IndexerStartupTask.java:82)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.sonar.server.es.IndexerStartupTask.indexUninitializedTypes(IndexerStartupTask.java:69)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at org.sonar.server.es.IndexerStartupTask.execute(IndexerStartupTask.java:55)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:84)
at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:46)
at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:80)
at org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:196)
at org.sonar.server.platform.Platform.access$400(Platform.java:46)
at org.sonar.server.platform.Platform$1.lambda$doRun$1(Platform.java:121)
at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
at org.sonar.server.platform.Platform$1.doRun(Platform.java:121)
at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes were available: [{sonarqube}{oFDAQZUaTxKW-KMYwkyq0w}{CiNrUYK3SbSdxF-NgXYcFA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}]
at org.elasticsearch.client.transport.TransportClientNodesService$RetryListener.onFailure(TransportClientNodesService.java:294)
at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:59)
at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1114)
at org.elasticsearch.transport.TransportService.lambda$onConnectionClosed$8(TransportService.java:963)
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:681)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
… 1 common frames omitted
Caused by: org.elasticsearch.transport.NodeDisconnectedException: [sonarqube][127.0.0.1:9001][indices:data/write/index] disconnected
2019.09.25 12:25:08 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process
2019.09.25 12:25:08 INFO web[o.s.s.n.NotificationDaemon] Notification service stopped
2019.09.25 12:25:10 INFO app[o.s.a.SchedulerImpl] Process[web] is stopped
2019.09.25 12:25:10 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped