Error binding SonarQube Server from VS2022 : Validating credentials failed: Internal error

  • Operating system: Windows 10 22H2
  • Visual Studio version: 2022 (17.13.3)
  • SonarQube for Visual Studio plugin version: 8.14.0.12562
  • Programming language you’re coding in: C# / JS
  • Is connected mode used: SonarQube Community Build (25.3.0.104237)

Hi,
When trying to bind SonarLint extension to SonarQube Server, I fill the user Token and got the following message : “Validating the connection failed. Please see the Output window for more information.”

Verbose Output :

[ThreadId 1] Initializing the telemetry package...
[ThreadId 1] Finished initializing the telemetry package...
[ThreadId 34] Initializing the daemon package...
[ThreadId 34] [Connection Migration] The connections.json file already exists. Migrating connections from existing bindings was not performed
[DEBUG] [ThreadId 1] [ConnectedMode/GitMonitor] No repo detected - nothing to monitor
[ThreadId 1] Current VS version:
    Visual Studio Professional 2022
    17.13.35828.75
    17.13.3
[ThreadId 11] [SLCoreHandler] Creating SLCore instance
[ThreadId 11] [SLCoreHandler] Starting SLCore instance
[ThreadId 11] Loaded settings from "C:\Users\cochonn\AppData\Roaming\SonarLint for Visual Studio\settings.json".
[ThreadId 11] [NodeJSLocator] Checking environment variable SONAR_NODEJS_PATH
[ThreadId 11] [NodeJsLocator] Environment variable is not set
[ThreadId 11] Finished initializing the daemon package.
[DEBUG] [ThreadId 63] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Started embedded server on port 64120
[DEBUG] [ThreadId 15] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Restoring previous local-only issue database from C:\Users\cochonn\AppData\Local\SLVS_SLOOP\storageRoot\local_only_issue_backup.tar.gz
[DEBUG] [ThreadId 6] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Starting local-only issue database from C:\Users\cochonn\AppData\Local\SLVS_SLOOP\workDir\xodus-local-only-issue-store7653741812546459075
[ThreadId 55] [SLCore] [jetbrains.exodus.io.FileDataWriter > SonarLint Server RPC sequential executor] Can't open directory channel. Log directory fsync won't be performed.
[DEBUG] [ThreadId 56] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Using default trace sample rate: 0.01
[ThreadId 1] Initializing the SonarQube for Visual Studio package...
[ThreadId 1] Finishing initializing the SonarQube for Visual Studio package
[ThreadId 1] [Connected Mode > Shared Binding] The shared binding configuration file was not found and will not be used. Probed path: not found
[DEBUG] [ThreadId 10] [SLCore] [sonarlint > httpclient-dispatch-2] Request failed
[DEBUG] [ThreadId 10] [SLCore] [sonarlint > httpclient-dispatch-2] java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(Unknown Source)
	at java.base/sun.nio.ch.SocketChannelImpl.read(Unknown Source)
	at org.apache.hc.core5.reactor.IOSessionImpl.read(IOSessionImpl.java:202)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:585)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession.access$000(SSLIOSession.java:74)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:200)
	at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:143)
	at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:176)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:125)
	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:92)
	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
	at java.base/java.lang.Thread.run(Unknown Source)

[DEBUG] [ThreadId 10] [SLCore] [sonarlint > SonarLint Server RPC request executor] GET https://sonarqube/api/system/status java.net.SocketException: Connection reset | failed after 108ms
[ThreadId 10] [SLCore] [org.eclipse.lsp4j.jsonrpc.RemoteEndpoint > SonarLint Server RPC request executor] Internal error: java.net.SocketException: Connection reset
[DEBUG] [ThreadId 10] [SLCore] [org.eclipse.lsp4j.jsonrpc.RemoteEndpoint > SonarLint Server RPC request executor] java.util.concurrent.CompletionException: java.net.SocketException: Connection reset
	at java.base/java.util.concurrent.CompletableFuture.reportJoin(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.join(Unknown Source)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processResponse(ServerApiHelper.java:130)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.rawGetUrl(ServerApiHelper.java:117)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.rawGet(ServerApiHelper.java:111)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.get(ServerApiHelper.java:76)
	at org.sonarsource.sonarlint.core.serverapi.system.SystemApi.lambda$getStatus$0(SystemApi.java:38)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:269)
	at org.sonarsource.sonarlint.core.serverapi.system.SystemApi.getStatus(SystemApi.java:37)
	at org.sonarsource.sonarlint.core.ConnectionManager.checkIfBearerIsSupported(ConnectionManager.java:91)
	at org.sonarsource.sonarlint.core.ConnectionManager.lambda$getClientFor$2(ConnectionManager.java:138)
	at org.eclipse.lsp4j.jsonrpc.messages.Either.map(Either.java:72)
	at org.sonarsource.sonarlint.core.rpc.protocol.common.Either.map(Either.java:66)
	at org.sonarsource.sonarlint.core.ConnectionManager.getClientFor(ConnectionManager.java:136)
	at org.sonarsource.sonarlint.core.ConnectionManager.getForTransientConnection(ConnectionManager.java:130)
	at org.sonarsource.sonarlint.core.ConnectionService.validateConnection(ConnectionService.java:156)
	at org.sonarsource.sonarlint.core.rpc.impl.ConnectionRpcServiceDelegate.lambda$validateConnection$3(ConnectionRpcServiceDelegate.java:72)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$0(AbstractRpcServiceDelegate.java:67)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.computeWithLogger(AbstractRpcServiceDelegate.java:135)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$1(AbstractRpcServiceDelegate.java:65)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(Unknown Source)
	at java.base/sun.nio.ch.SocketChannelImpl.read(Unknown Source)
	at org.apache.hc.core5.reactor.IOSessionImpl.read(IOSessionImpl.java:202)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:585)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession.access$000(SSLIOSession.java:74)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:200)
	at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:143)
	at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:176)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:125)
	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:92)
	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
	... 1 common frames omitted

[DEBUG] [ThreadId 66] [SlCoreConnectionAdapter] Validating credentials failed: Internal error.
[ThreadId 1] [Connected Mode > Shared Binding] The shared binding configuration file was not found and will not be used. Probed path: not found

For information :

  • the token has been generated with Type = User, No expiration.
  • the “Generate Token” button in SonarLint Extension leads to an error in Sonar Server : “Token generation failed” + “The minimum value for parameter expirationDate is 2025-03-19”
  • With VS2017 + SonarLint 5.5.0.43817, binding works with the same Token

Thank you for your help.

Hello @ncochon,

First I would like to welcome you to our Community! :sonar:

The SocketException might be caused by security configurations on the machine.

There are several things you could try:
1.Maybe a firewall is blocking the connection. Could you temporarily disable it to see if the problem persists?

2.Follow this documentation to configure the server certificate to the SonarQube for Visual Studio’s backend

3.If you already have installed and configured a JDK on your machine, consider changing the JRE path inside SonarQube for Visual Studio to point to it.
The point here being that maybe you have security software that requires to add the Root CA certificate used for traffic inspection to the Java keystore.

  • the “Generate Token” button in SonarLint Extension leads to an error in Sonar Server : “Token generation failed” + “The minimum value for parameter expirationDate is 2025-03-19”

Regarding the token generation, this is an issue that has been fixed and it will be delivered with the next version of SonarQube Community Build. As a workaround until then, the token has to be manually filled.

Let me know if any of my proposed solutions helps you with your problem!

Thank you @gabriela.trutan for your support.
I finaly found the issue : the server certificate was not created with the FQDN alias name.
A new certificate have been generated with then FQDN alias, and SonarLint binding is now working with this FQDN name.
:partying_face:

2 Likes

I am so glad to hear that, @ncochon!
Happy clean coding! :sonar: