Unable to connect to the sonarqube server with intellijin even aftter adding certificate to the JVM keystore

I am trying to connect to the sonarbaeque server using Sonarlint and get the following error

java.lang.IllegalStateException: Error 503 on http://****.****.****.****:portNumber
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.handleError(SonarLintWsClient.java:146)
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.get(SonarLintWsClient.java:87)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.lambda$fetchServerInfos$0(ServerVersionAndStatusChecker.java:97)
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.processTimed(SonarLintWsClient.java:226)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.fetchServerInfos(ServerVersionAndStatusChecker.java:96)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:60)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:50)
    at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:65)
    at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:58)
    at org.sonarlint.intellij.tasks.ConnectionTestTask.run(ConnectionTestTask.java:53)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:932)
    at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:482)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:77)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$null$3(ProgressRunner.java:233)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:166)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:153)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:233)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

I am trying to connect to the sonarbaeque server using Sonarlint and get the following error :

java.lang.IllegalStateException: Error 503 on http://****.****.****.****:portNumber
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.handleError(SonarLintWsClient.java:146)
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.get(SonarLintWsClient.java:87)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.lambda$fetchServerInfos$0(ServerVersionAndStatusChecker.java:97)
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.processTimed(SonarLintWsClient.java:226)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.fetchServerInfos(ServerVersionAndStatusChecker.java:96)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:60)
    at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:50)
    at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:65)
    at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:58)
    at org.sonarlint.intellij.tasks.ConnectionTestTask.run(ConnectionTestTask.java:53)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:932)
    at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:482)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:77)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$null$3(ProgressRunner.java:233)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:166)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:153)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:233)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

The thing is I already added the certificate to the JVM keystore locate in JAVA_HOME/bin/lib/security cacert file. I also add the proxy section to settings.xml file in the Maven root folder and .m2 folder and they worked well. But for the Sonarlint this was not the case.
Intelliji version: 2020.1.3
SonarLint version: 4.9.0.19370

Welcome :slight_smile:

AFAIK IntelliJ ships with his own Java runtime.
Maybe you need to use $IntelliJIDEAInstalldir\jbr\lib\security\cacerts

Gilbert

Thank you. I add the cacerts to $IntelliJIDEAInstalldir\jbr\lib\security\cacerts but I still got the same error

Hello, thanks for reporting this.

As far as I can tell, a 503 error code can happen e.g if your SonarQube server is behind a reverse proxy but not available, or when an upgrade is running. You might want to check that your server is available with a Web browser before configuring connected mode.

I also note that you logs mention a clear text http:// URL scheme, not a secure https://, so I don’t quite understand why you would add a certificate to the JVM keystore. Could this be a typo?

the server is available with the web browser. It shows status “up”
Yeah you are right i dont need the ssl certificate to make it work since it is http not https. But the funny thing is with the Intelliji UX. You have to explicitly click on checkbox “No Proxy” Option so that no proxy is INDEED enabled


Otherwise although it looks deceivingly no proxy is enabled on this picture

But as a matter of fact, Auto-detect proxy settings is enabled.
I should have looked carefully though.
But i still don’t understand why it doesn’t work the http option

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