2

I use Intellij Idea and i want to use SonarLint for detecting bugs and quality issues. When i tried to connect SonarLint to my corporate Sonar server i got following error

Failed to connect to the server. Please check the configuration.

Excerpt from log file:

INFO - ellij.tasks.ConnectionTestTask - Connection test failed 
java.lang.NullPointerException
    at com.intellij.util.net.ssl.ConfirmingTrustManager$MutableTrustManager.keyStoreIsEmpty(ConfirmingTrustManager.java:450)
    at com.intellij.util.net.ssl.ConfirmingTrustManager$MutableTrustManager.getAcceptedIssuers(ConfirmingTrustManager.java:429)
    at okhttp3.internal.tls.TrustRootIndex.get(TrustRootIndex.java:43)
    at okhttp3.internal.platform.Platform.buildCertificateChainCleaner(Platform.java:167)
    at okhttp3.internal.tls.CertificateChainCleaner.get(CertificateChainCleaner.java:41)
    at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.java:695)
    at org.sonarsource.sonarlint.core.util.ws.OkHttpClientBuilder.build(OkHttpClientBuilder.java:183)
    at org.sonarsource.sonarlint.core.util.ws.HttpConnector.<init>(HttpConnector.java:85)
    at org.sonarsource.sonarlint.core.util.ws.HttpConnector.<init>(HttpConnector.java:50)
    at org.sonarsource.sonarlint.core.util.ws.HttpConnector$Builder.build(HttpConnector.java:293)
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.buildClient(SonarLintWsClient.java:73)
    at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.<init>(SonarLintWsClient.java:60)
    at org.sonarsource.sonarlint.core.WsHelperImpl.createClient(WsHelperImpl.java:81)
    at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:53)
    at org.sonarlint.intellij.tasks.ConnectionTestTask.run(ConnectionTestTask.java:52)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:710)
    at com.intellij.openapi.progress.impl.CoreProgressManager$11.run(CoreProgressManager.java:423)
    at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:179)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:568)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:519)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:164)
    at com.intellij.openapi.application.impl.ApplicationImpl.a(ApplicationImpl.java:572)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:309)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)  

How can i solve this problem?

iChrome
  • 443
  • 1
  • 6
  • 24
  • Seems to be related to https certificates. SonarLint tries to use certificates configured in IntelliJ. Do you have anything configured in Settings -> Tools -> Server certificates? – Duarte Meneses Oct 31 '17 at 16:21
  • No, i haven't accepted any certificates. On `Server certificates` i have only checked `Accept non-trusted certificates automatically`. And it's pretty strange, because for connecting to remote Sonar server i use http, not https. So, i assume it shouldn't use any ssl certificates. – iChrome Nov 01 '17 at 09:25
  • 1
    SonarLint will try to set in its HTTP library the Intellij's truststore and keystore even if the connection is not secure. Looking at IntelliJ's code, it looks like it failed to create a key store. Could you check in IntelliJ's log file if you have an error on startup with a stack trace? It would have the message either "Cannot create directories" or "Cannor create key store". – Duarte Meneses Nov 01 '17 at 09:36
  • I found few errors about my key store. I have changed Idea boot JDK, and now it's working. I succesfully connected to remote Sonar server. Thanks for your help. – iChrome Nov 02 '17 at 08:59

0 Answers0