SonarLint error using SonarLint plugin for VsCode: No storage for server 'mySonarQube'. Please update

Hi, here is my environment:

OS: Windows 10
SonarLint Extension For VSCode version: 1.12.0
SonarQube server version: Version 6.7.4
java version “1.8.0_221”
Java™ SE Runtime Environment (build 1.8.0_221-b33)
Java HotSpot™ Client VM (build 25.221-b33, mixed mode)

Possibly a certificate error? See logs below

Note that if I hit https://sonar.traderz.com/api/system/status with my browser, I get a valid json response back: {“id”:“REDACTED”,“version”:“6.7.4.38452”,“status”:“UP”}

Here log of the error:

Executing C:\Program Files\Java\jdk-13.0.1\bin\java -jar c:\Users\james.t.gibson\.vscode\extensions\sonarsource.sonarlint-vscode-1.12.0\server\sonarlint-ls.jar 1811 file:///c:/Users/james.t.gibson/.vscode/extensions/sonarsource.sonarlint-vscode-1.12.0/analyzers/sonarjs.jar file:///c:/Users/james.t.gibson/.vscode/extensions/sonarsource.sonarlint-vscode-1.12.0/analyzers/sonarphp.jar file:///c:/Users/james.t.gibson/.vscode/extensions/sonarsource.sonarlint-vscode-1.12.0/analyzers/sonarpython.jar file:///c:/Users/james.t.gibson/.vscode/extensions/sonarsource.sonarlint-vscode-1.12.0/analyzers/sonarts.jar file:///c:/Users/james.t.gibson/.vscode/extensions/sonarsource.sonarlint-vscode-1.12.0/analyzers/sonarhtml.jar
Binding to 1811
Child process connected on port 1811
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.sonarsource.sonarlint.shaded.com.google.gson.internal.reflect.UnsafeReflectionAccessor (file:/C:/Users/james.t.gibson/.vscode/extensions/sonarsource.sonarlint-vscode-1.12.0/server/sonarlint-ls.jar) to field java.time.LocalDate.year
WARNING: Please consider reporting this to the maintainers of org.sonarsource.sonarlint.shaded.com.google.gson.internal.reflect.UnsafeReflectionAccessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Starting standalone SonarLint engine...
Using 5 analyzers
Starting connected SonarLint engine for 'mySonarQube'...
Global settings updated: WorkspaceSettings[disableTelemetry=false,servers={mySonarQube=ServerConnectionSettings[serverId=mySonarQube,serverUrl=https://sonar.traderz.com,token=REMOVED,organizationKey=<null>]},excludedRules=[],includedRules=[]]
Workspace workspaceFolderPath 'WorkspaceFolder[uri=file:///c%3A/Dev/car-web-lip-sdk,name=car-web-lip-sdk]' configuration updated: WorkspaceFolderSettings[analyzerProperties={},testFilePattern={**/test/**,**/*test*,**/*Test*},serverId=mySonarQube,projectKey=AD00001863_car-web-lip-sdk:develop]
Create : C:\Users\james.t.gibson\.sonarlint\plugins
Plugin cache: C:\Users\james.t.gibson\.sonarlint\plugins
Create : C:\Users\james.t.gibson\.sonarlint\plugins\_tmp
Create : C:\Users\james.t.gibson\.sonarlint\plugins
Plugin cache: C:\Users\james.t.gibson\.sonarlint\plugins
Create : C:\Users\james.t.gibson\.sonarlint\plugins\_tmp
Load plugins
Load plugins (done) | time=1ms
No plugins loaded
[Warn  - 4:51:16 PM] No storage for server 'mySonarQube'. Please update.
Connected SonarLint engine started for 'mySonarQube'
Load plugins
Load plugins (done) | time=13ms
Plugins:
  * SonarPHP 3.2.0.4868 (php)
  * SonarPython 1.15.1.4116 (python)
  * SonarTS 1.9.0.3766 (typescript)
  * SonarHTML 3.2.0.2082 (web)
  * SonarJS 5.1.1.7506 (javascript)
Create : C:\Users\james.t.gibson\.sonarlint\plugins
Plugin cache: C:\Users\james.t.gibson\.sonarlint\plugins
Create : C:\Users\james.t.gibson\.sonarlint\plugins\_tmp
Create : C:\Users\james.t.gibson\.sonarlint\plugins
Plugin cache: C:\Users\james.t.gibson\.sonarlint\plugins
Create : C:\Users\james.t.gibson\.sonarlint\plugins\_tmp
Load plugins
Load plugins (done) | time=0ms
No plugins loaded
[Warn  - 4:51:16 PM] No storage for server 'mySonarQube'. Please update.
[Error - 4:51:16 PM] Error updating storage of the connected SonarLint engine 'mySonarQube'
[Error - 4:51:16 PM] java.lang.IllegalStateException: Fail to request https://sonar.traderz.com/api/system/status
	at org.sonarsource.sonarlint.core.util.ws.HttpConnector.doCall(HttpConnector.java:196)
	at org.sonarsource.sonarlint.core.util.ws.HttpConnector.get(HttpConnector.java:122)
	at org.sonarsource.sonarlint.core.util.ws.HttpConnector.call(HttpConnector.java:109)
	at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.rawGet(SonarLintWsClient.java:120)
	at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.get(SonarLintWsClient.java:85)
	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:227)
	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.container.connected.update.perform.GlobalStorageUpdateExecutor.update(GlobalStorageUpdateExecutor.java:77)
	at org.sonarsource.sonarlint.core.container.connected.ConnectedContainer.update(ConnectedContainer.java:115)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$1(ConnectedSonarLintEngineImpl.java:174)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.runInConnectedContainer(ConnectedSonarLintEngineImpl.java:311)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:174)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:325)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:169)
	at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.updateGlobalStorageAndLogResults(ProjectBindingManager.java:383)
	at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.createConnectedEngineAndUpdateIfNeeded(ProjectBindingManager.java:182)
	at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.lambda$getOrCreateConnectedEngine$0(ProjectBindingManager.java:161)
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1138)
	at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getOrCreateConnectedEngine(ProjectBindingManager.java:161)
	at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.computeProjectBinding(ProjectBindingManager.java:131)
	at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getBinding(ProjectBindingManager.java:115)
	at org.sonarsource.sonarlint.ls.SonarLintLanguageServer.lambda$codeAction$2(SonarLintLanguageServer.java:264)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:324)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:262)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:641)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:460)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:360)
	at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:422)
	at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1460)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1368)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:437)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:336)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:300)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.RealConnection.connect(RealConnection.java:185)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.sonarlint.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.sonarlint.shaded.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
	at org.sonarsource.sonarlint.shaded.okhttp3.RealCall.execute(RealCall.java:81)
	at org.sonarsource.sonarlint.core.util.ws.HttpConnector.doCall(HttpConnector.java:194)
	... 31 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:384)
	at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:289)
	at java.base/sun.security.validator.Validator.validate(Validator.java:264)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:625)
	... 62 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
	at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:379)
	... 67 more

Default settings updated: WorkspaceFolderSettings[analyzerProperties={},testFilePattern={**/test/**,**/*test*,**/*Test*},serverId=mySonarQube,projectKey=AD00001863_car-web-lip-sdk:develop]
Analysis triggered on 'file:///c%3A/Dev/car-web-lip-sdk/src/lib/services/utility.service.ts' with configuration: 
[
  baseDir: c:\Dev\car-web-lip-sdk
  extraProperties: {}
  excludedRules: []
  includedRules: []
  inputFiles: [
    file:///c%3A/Dev/car-web-lip-sdk/src/lib/services/utility.service.ts (UTF-8) [ts]
  ]
]

[Info  - 4:51:16 PM] Starting SonarTS Server
Deploying bundle to C:\Users\james.t.gibson\.sonarlint\work\.sonartmp_8858076337934164777\2499656085238538966
[Info  - 4:51:27 PM] Using typescript at [c:\Users\james.t.gibson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript], version 3.6.3
[Info  - 4:51:27 PM] SonarTS Server is started
[Info  - 4:51:27 PM] SonarTS Server connected to 1825
Standalone SonarLint engine started
Available languages:
  * PHP => "php"
  * Python => "py"
  * TypeScript => "ts"
  * HTML => "web"
  * JSP => "jsp"
  * JavaScript => "js"
Start analysis
Declared extensions of language PHP were converted to php: **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
Declared extensions of language Python were converted to py: **/*.py
Declared extensions of language TypeScript were converted to ts: **/*.ts,**/*.tsx
Declared extensions of language HTML were converted to web: **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,**/*.jspf,**/*.jspx
Declared extensions of language JavaScript were converted to js: **/*.js,**/*.jsx,**/*.vue
[Info  - 4:51:27 PM] Index files
Language of file 'file:///c%3A/Dev/car-web-lip-sdk/src/lib/services/utility.service.ts' is set to 'ts'
[Info  - 4:51:27 PM] 1 file indexed
'PHP sensor' skipped because there is no related file in current project
'Analyzer for "php.ini" files' skipped because there is no related file in current project
'Python Squid Sensor' skipped because there is no related file in current project
Execute Sensor: Contextual SonarTS
[Info  - 4:51:27 PM] Started SonarTS Analysis

Also, here is my settings configuration in VSCode:

{
    "git.confirmSync": false,
    "window.zoomLevel": 1,
    "sonarlint.connectedMode.servers": [
          { "serverId": "mySonarQube", "serverUrl": "https://sonar.traderz.com", "token": "REDACTED" }
    ],
    "sonarlint.connectedMode.project": {
          "serverId": "mySonarQube",
          "projectKey": "AD0000ZZZZ_car-web-lip-sdk:develop"
}
}

Hi @James_Garza

This indeed look like a self signed certificate. To fix the problem, you would have to import this certificate in the truststore of the JVM used by the SonarLint language server (C:\Program Files\Java\jdk-13.0.1).

See instructions here, and don’t hesitate to ask if you need more details.

Thanks for the help :smile: I looked at the documentation and am working on implementing. However, does the log indicate which certificate is required? If not any ideas on how to identify the certificate?

This is the SSL certificate of your SonarQube server: https://sonar.traderz.com/
You can download the certificate with your browser, then convert it to pem format with openssl:
https://superuser.com/questions/1291416/download-pem-via-browser-only
Or more directly:
https://superuser.com/a/176721/207108