Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube server 8-community running from official Docker image - what are you trying to achieve
First attempts at connection to corporate LDAP (MS/AD) - what have you tried so far to achieve this
We’ve successfully connected a Dependency Track instance to our LDAP, and attempted knowledge transfer to our SonarQube setup. Followed details on Environment Variables from https://docs.sonarqube.org/latest/setup/environment-variables/#header-4 and used these in docker start-script:
-e SONAR_SECURITY_REALM=LDAP \
-e LDAP_URL=ldaps://ldap-vip.example.com:3269 \
-e LDAP_REALM=example.com \
But our results were stack-trace in logs:
2020.04.01 01:37:47 INFO web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2020.04.01 01:37:47 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@5378261d [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]
2020.04.01 01:37:47 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2020.04.01 01:37:49 INFO web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
2020.04.01 01:37:50 INFO web[][o.s.s.s.LogServerId] Server ID: 6CF5BE4F-AWRIk3VFrEe_XNA6vi10
2020.04.01 01:37:50 INFO web[][org.sonar.INFO] Security realm: LDAP
2020.04.01 01:37:50 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.sonar.api.utils.SonarException: Security realm fails to start: The property 'ldap.url' is empty and no realm configured to try auto-discovery.
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:93)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
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:555)
at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:213)
at org.sonar.server.platform.PlatformImpl.startLevel34Containers(PlatformImpl.java:187)
at org.sonar.server.platform.PlatformImpl.access$500(PlatformImpl.java:46)
at org.sonar.server.platform.PlatformImpl$1.lambda$doRun$0(PlatformImpl.java:120)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:370)
at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:120)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:354)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.sonar.auth.ldap.LdapException: The property 'ldap.url' is empty and no realm configured to try auto-discovery.
at org.sonar.auth.ldap.LdapSettingsManager.initSimpleLdapConfiguration(LdapSettingsManager.java:172)
at org.sonar.auth.ldap.LdapSettingsManager.getContextFactories(LdapSettingsManager.java:145)
at org.sonar.auth.ldap.LdapRealm.init(LdapRealm.java:54)
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:87)
... 19 common frames omitted
2020.04.01 01:37:50 INFO web[][o.s.p.ProcessEntryPoint] Hard stopping process
2020.04.01 01:37:50 INFO app[][o.s.a.SchedulerImpl] Process[web] is stopped
2020.04.01 01:37:50 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.04.01 01:37:50 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143
2020.04.01 01:37:50 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped