Sonar.sh and sonar properties file are missing in SonarQube 7.9.6

Hi,

I have created stack for SonarQube (version: 7.9.6, community) on Kubernetes Platform and it is working fine. I am getting UI and able to login.

I have taken below as reference to build the image:
(docker-sonarqube/7/community at master · SonarSource/docker-sonarqube · GitHub)

I noticed that I’m not able to find “sonar.sh” file under path “/opt/sonarqube/bin” so I am not sure how would I be able to start or stop the sonarqube without sonar.sh file.

Also, I am not able to see “sonar.properties” and “wrapper.conf” under path “/opt/sonarqube/conf”

Can anyone please help me to suggest if I need to make changes in Dockerfile (which is used to create sonarqube image) or any other work around ?

Thanks,
Vaibhav Jariwala

Hi @jariwala ,

when you are working on kubernetes you should be able to restart the pod via kubectl (as in kill and let k8s recreate the pod), so these scripts are not needed.
as for sonar.properties this is ment to be provided with the deployment, so you could create a configmap to be consumed by sonarqube or rely on environment variables with the current LTS (8.9) as the 7.9 LTS will be end of live soon.

Thanks @Tobias_Trabelsi for replying back.

In order to use sonar.properties for LDAP configuration, I have created configMap as you suggested.

ConfigMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: sonar-properties-configmap
  labels:
    app: sonar
    version: 0.1.0
data:
  sonar.properties: |
    sonar.security.realm=LDAP
    sonar.authenticator.downcase=true
    ldap.realm=AD.companyname.COM
    ldap.url=ldap://ad.companyname.com:389
    ldap.bindDn=CN=DA-Sonar DA-Sonar,OU=Service Accounts,DC=ad,DC=companyname,DC=com
    ldap.bindPassword=password
    ldap.user.baseDn=dc=ad,dc=companyname,dc=com
    ldap.user.request=sAMAccountName={0}

I have added updated deployment.yaml file as below:

volumeMounts:
  - mountPath: "/kubeconf/"
    name: sonar-properties-configmap
lifecycle:
  postStart:
    exec:
      command: ["cp", "/kubeconf/sonar.properties", "/opt/sonarqube/conf/"]

I have added section in volumes too as below:

volumes:
  - name: sonar-properties-configmap
      configMap:
        name: sonar-properties-configmap

My pod get started and facing below error:

2021.05.27 10:00:35 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks

2021.05.27 10:00:38 INFO es[][o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{Ww21KeozTc2B5LRu5Va2Xg}{UmuyEcCbTLeZvOEzS6UTTA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}

2021.05.27 10:00:38 INFO es[][o.e.c.s.ClusterApplierService] new_master {sonarqube}{Ww21KeozTc2B5LRu5Va2Xg}{UmuyEcCbTLeZvOEzS6UTTA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{Ww21KeozTc2B5LRu5Va2Xg}{UmuyEcCbTLeZvOEzS6UTTA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])

2021.05.27 10:00:38 INFO es[][o.e.n.Node] started

2021.05.27 10:00:39 INFO es[][o.e.g.GatewayService] recovered [7] indices into cluster_state

2021.05.27 10:00:39 INFO es[][o.e.c.r.a.AllocationService] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[components][4], [metadatas][0]] ...]).

2021.05.27 10:00:46 INFO es[][o.e.n.Node] stopping ...

2021.05.27 10:00:46 INFO es[][o.e.n.Node] stopped

2021.05.27 10:00:46 INFO es[][o.e.n.Node] closing ...

2021.05.27 10:00:46 INFO es[][o.e.n.Node] closed

2021.05.27 10:00:49 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp

2021.05.27 10:00:49 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001

2021.05.27 10:00:49 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch

2021.05.27 10:00:49 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running

2021.05.27 10:00:49 INFO app[][o.e.p.PluginsService] no modules loaded

2021.05.27 10:00:49 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.

2021.05.27 10:00:51 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/opt/sonarqube/data (/dev/nvme2n1)]], net usable_space [2.8gb], net total_space [2.8gb], types [ext4]

2021.05.27 10:00:51 INFO es[][o.e.e.NodeEnvironment] heap size [494.9mb], compressed ordinary object pointers [true]

2021.05.27 10:00:51 INFO es[][o.e.n.Node] node name [sonarqube], node ID [Ww21KeozTc2B5LRu5Va2Xg]

2021.05.27 10:00:51 INFO es[][o.e.n.Node] version[6.8.0], pid[35], build[default/tar/65b6179/2019-05-15T20:06:13.172855Z], OS[Linux/3.10.0-1160.15.2.el7.x86_64/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/11.0.6/11.0.6+10]

2021.05.27 10:00:51 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.enforce.bootstrap.checks=true, -Xms512m, -Xmx512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [analysis-common]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [lang-painless]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [mapper-extras]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [parent-join]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [percolator]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [reindex]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [repository-url]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]

2021.05.27 10:00:52 INFO es[][o.e.p.PluginsService] no plugins loaded

2021.05.27 10:00:54 WARN es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.

2021.05.27 10:00:55 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]

2021.05.27 10:00:55 INFO es[][o.e.n.Node] initialized

2021.05.27 10:00:55 INFO es[][o.e.n.Node] starting ...

2021.05.27 10:00:55 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}

2021.05.27 10:00:55 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks

2021.05.27 10:00:58 INFO es[][o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{Ww21KeozTc2B5LRu5Va2Xg}{1a9Pj1URQCyb_tqCm2P3jA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}

2021.05.27 10:00:58 INFO es[][o.e.c.s.ClusterApplierService] new_master {sonarqube}{Ww21KeozTc2B5LRu5Va2Xg}{1a9Pj1URQCyb_tqCm2P3jA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{Ww21KeozTc2B5LRu5Va2Xg}{1a9Pj1URQCyb_tqCm2P3jA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])

2021.05.27 10:00:58 INFO es[][o.e.n.Node] started

2021.05.27 10:00:59 INFO es[][o.e.g.GatewayService] recovered [7] indices into cluster_state

2021.05.27 10:01:00 INFO es[][o.e.c.r.a.AllocationService] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[components][2], [metadatas][0]] ...]).

2021.05.27 10:01:01 INFO app[][o.s.a.SchedulerImpl] Process[es] is up

2021.05.27 10:01:01 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /opt/java/openjdk/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/common/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.2.5.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process2360803306481846596properties

2021.05.27 10:01:01 INFO web[][o.s.p.ProcessEntryPoint] Starting web

2021.05.27 10:01:02 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read

2021.05.27 10:01:03 INFO web[][o.e.p.PluginsService] no modules loaded

2021.05.27 10:01:03 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]

2021.05.27 10:01:03 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]

2021.05.27 10:01:03 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]

2021.05.27 10:01:04 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]

2021.05.27 10:01:04 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 7.9.6.41879 / 38d385dda4435530bb4fdf77e0d28e31c401a976

2021.05.27 10:01:04 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonarqubedevdptest.ctzksopipr55.us-east-1.rds.amazonaws.com:5432/sonar

2021.05.27 10:01:05 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube

2021.05.27 10:01:05 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled

2021.05.27 10:01:05 INFO web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8

2021.05.27 10:01:05 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@3aca2062 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/properties*, ...]}]

2021.05.27 10:01:06 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000

2021.05.27 10:01:06 INFO web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)

2021.05.27 10:01:06 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube

java.lang.IllegalStateException: Unable to load component class org.sonar.server.platform.ws.SystemWs

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)

at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)

at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)

at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)

at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)

at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)

at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)

at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)

at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)

at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)

at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)

at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)

at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)

at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)

at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)

at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)

at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)

at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:545)

at org.sonar.server.platform.Platform.start(Platform.java:211)

at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185)

at org.sonar.server.platform.Platform.access$500(Platform.java:46)

at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119)

at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)

at org.sonar.server.platform.Platform$1.doRun(Platform.java:119)

at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.server.platform.ws.InfoAction

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)

at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)

at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)

at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)

at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)

at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)

at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)

at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)

at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)

at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)

at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)

at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)

at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)

... 28 common frames omitted

Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.server.platform.ws.StandaloneSystemInfoWriter

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)

at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)

at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)

at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)

at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)

at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)

at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)

at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)

at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)

at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)

at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)

... 44 common frames omitted

Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.server.platform.monitoring.StandaloneSystemSection

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)

at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)

at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)

at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)

at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)

at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)

at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)

at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)

at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)

at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)

at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)

at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)

at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)

... 58 common frames omitted

Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.server.user.SecurityRealmFactory

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)

at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)

at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)

at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)

at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)

at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)

at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)

at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)

at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)

at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)

at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)

... 74 common frames omitted

Caused by: org.sonar.api.utils.SonarException: Realm 'LDAP' not found. Please check the property 'sonar.security.realm' in conf/sonar.properties

at org.sonar.server.user.SecurityRealmFactory.<init>(SecurityRealmFactory.java:54)

at org.sonar.server.user.SecurityRealmFactory.<init>(SecurityRealmFactory.java:78)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)

at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)

at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)

at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)

at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)

at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)

at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)

at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)

... 88 common frames omitted

2021.05.27 10:01:07 INFO web[][o.s.p.ProcessEntryPoint] Hard stopping process

2021.05.27 10:01:07 INFO app[][o.s.a.SchedulerImpl] Process[web] is stopped

2021.05.27 10:01:07 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143

2021.05.27 10:01:07 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2021.05.27 10:01:07 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped

It seems plugins are not getting loaded in “/opt/sonarqube/extensions/” directory.
I would like to make a note that we have dedicated PVC for extensions directory.

Can you please help me to understand what I am missing ?

Thanks.
Vaibhav Jariwala

Hi @jariwala ,

i assume that you basically removed all plugins that should be shipped with SQ with this action, so that the folder /opt/sonarqube/extensions/plugins is empty and therefore the LDAP plugin is missing. You might want to update to the current LTS (8.9) as in that release the bundled analyzers are independent from 3rd party plugins and ldap support is also embedded.

if you still with to stick to 7.9, which again will be EOL soon, you need to populate your PV with the bundled plugins in order to make your configuration work

Hi @Tobias_Trabelsi
Thanks for replying on quick basis.

I haven’t removed any plugins from /opt/sonarqube/extensions/plugins

Please note that my setup was working fine before making recent changes (creating configmap and updating deployment.yaml for sonar.properties file)

Requirement from management is to setup SonarQube for 7.x version at the moment and so trying hard to keep everything working on plate.

if you still with to stick to 7.9, which again will be EOL soon, you need to populate your PV with the bundled plugins in order to make your configuration work

Do you mean to say that we should first copy all plugins under that path (before starting deployment/Pod) ?

Any other workarounds to make it happen ?

I was not implying that you intentionally removed all the plugins, but more that the PV is empty now where in the image there should be plugins, including the ldap plugin. can you confirm this?
if this is the case the LDAP plugin is missing resulting in the observed failure during the startup as the config map seems to be passed to SQ from what i see in the logs.

hmm you could use a init container to copy the plugins in the PV prior to starting SQ. just an idea

Thanks @Tobias_Trabelsi ,

I have created configMap to create script that would take care of copy operation.
I have created init container that would execute this script.

After above modifications, I am getting expected outcomes.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.