IllegalStateException: Visual Studio - When Binding Connection/Project

  • ALM used Azure DevOps
  • CI system used Azure DevOps
  • Scanner command used when applicable (private details masked)
  • Languages of the repository - C#
  • IDE: Visual Studio 2022, version 17.14.5, Community Edition
  • Version: Sonar Qube 8.20.0.13314
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

Trying to Bind my Connection > Project
Connection: Go into Wizard,
Manage Connections >
New Connection >
SonarQube cloud >
Enter Token from https://sonarcloud.io/account/security

Error Shown below:

[ThreadId 1] [Connected Mode > Shared Binding] The shared binding configuration file was not found and will not be used. Probed path: not found

[ThreadId 325] [SLCore] [org.eclipse.lsp4j.jsonrpc.RemoteEndpoint > SonarLint Server RPC request executor] Internal error: java.lang.IllegalStateException: Backend is not initialized

[DEBUG] [ThreadId 325] [SLCore] [org.eclipse.lsp4j.jsonrpc.RemoteEndpoint > SonarLint Server RPC request executor] java.util.concurrent.CompletionException: java.lang.IllegalStateException: Backend is not initialized

at java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:325)

at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:361)

at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:366)

at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:695)

at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:528)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619)

at java.base/java.lang.Thread.run(Thread.java:1447)

Caused by: java.lang.IllegalStateException: Backend is not initialized

at org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl.getInitializedApplicationContext(SonarLintRpcServerImpl.java:160)

at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.getBean(AbstractRpcServiceDelegate.java:51)

at org.sonarsource.sonarlint.core.rpc.impl.ConnectionRpcServiceDelegate.lambda$validateConnection$3(ConnectionRpcServiceDelegate.java:73)

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:154)

at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$1(AbstractRpcServiceDelegate.java:65)

at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:692)

... 4 common frames omitted

[DEBUG] [ThreadId 123] [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
  • Steps to reproduce
  • Potential workaround

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hello @alias47,

Welcome to the community! :sonar:

I need some more information to fully understand the issue. To dig deeper, could you please share the full Verbose logs ?

Note: the above post was showing Verbose logs when I was trying to add new Connection.

I have now copied another user’s %AppData%/SonarLint for Visual Studio folder (which works perfectly for them)

When I go to Manage Binding, I can see VALID entries in Connection to Bind, and Project To Bind, but get the error and cannot select the Project - see screenshot..

Verbose Log:

[DEBUG] [ThreadId 61] [SlCoreConnectionAdapter] Failed to get project name by key: Unexpected ICredentialsModel argument
[ThreadId 1] [Connected Mode > Shared Binding] The shared binding configuration file was not found and will not be used. Probed path: not found

Hello @alias47,

What I mean is: can you, please, attach the verbose logs that are shown in the Output window since starting the VS instance and up until you open the Manage Project Binding window (including maybe adding your connection via the Manage Connections)? I would need some wider context to understand what causes the problem on your case.

I have now copied another user’s %AppData%/SonarLint for Visual Studio folder (which works perfectly for them)

Unfortunately this is not a valid workaround. You do see indeed the connection and the project to bind, but the credentials for the connections are not added on your Windows Credentials. You will have to use the UI for that, see the documentation on how to create a new connection.