Add sonarqube connection is not working in vs code

Please provide

  • Operating system:
    windows 10
  • SonarLint plugin version:
    3.18.0
  • Programming language you’re coding in:
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version):
      I am trying to add new sonar qube connection from vs code, it is not opening, due to that i am not able to add new connections from vscode

And a thorough description of the problem / question:

Hello @anand_mohan_reddy, and welcome to Sonar Community! :sonar: :wave:

Unfortunately, I am not able to reproduce this behavior. Could you please provide more details on the steps that you are taking and what exactly do you observe? And, if the issue persists, please provide us with logs from SonarLint output.

All the best,
Sophio :sonarlint:

I’m also having the same issue.

Version: sonarsource.sonarlint-vscode-3.19.0-darwin-arm64/jre/17.0.7-macosx-aarch64.tar/bin/java
OS: Mac OS
Error:

[Error - 21:41:15.188] Failed to get project list
[Error - 21:41:15.188] java.lang.IllegalStateException: Unable to parse WS response: Protocol message contained an invalid tag (zero).
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:252)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.consumeTimed(ServerApiHelper.java:274)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.getPaginated(ServerApiHelper.java:197)
	at org.sonarsource.sonarlint.core.serverapi.component.ComponentApi.getAllProjects(ComponentApi.java:67)
	at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.downloadAllProjects(ServerConnection.java:125)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$downloadAllProjects$12(ConnectedSonarLintEngineImpl.java:376)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.wrapErrors(ConnectedSonarLintEngineImpl.java:524)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.downloadAllProjects(ConnectedSonarLintEngineImpl.java:376)
	at org.sonarsource.sonarlint.ls.connected.ProjectBindingManager.getRemoteProjects(ProjectBindingManager.java:603)
	at org.sonarsource.sonarlint.ls.SonarLintLanguageServer.getRemoteProjectsForConnection(SonarLintLanguageServer.java:604)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.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)

Hello Ivan,

Thank you for the logs. This looks strange but I cannot reproduce it. Which version of SonarQube are you using?

Best,
Sophio

10.1 and 10.0 have the same behavior.

Hi Ivan, please also kindly specify which SonarQube edition you use? I want to try reproducing the behavior you describe.

Best,
Sophio

Developer Edition

1 Like

Unfortunately, I cannot reproduce this with SonarQube Version 10.1 (build 73491) and SonarLint for VSCode v3.19. If it helps, as a workaround, you can create binding by editing your /project/.vscode/settings.json file as in the example below, specifying the connectionId and projectKey.

All the best,
Sophio

@pragmaticivan did you happen to recently update your SonarQube version? If so, from which version did you upgrade once you started seeing this error? Also, would it be possible for you to provide logs from SonarQube when you try to create binding?

Thank you,
Sophio

1 Like

Hi, I figured out the problem.

Both SonarQube Github Actions and SonarLint don’t work well when an ingress proxy has compression enabled.

We had Traefik in front of SonarQube and it was not able to work well with that enabled.

I disabled compression just for SQ and it all started working again.

1 Like

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