Visual Studio 2022 SonarLint Connection Mode to SonarQube reconnection issues

Please provide

  • Operating system: Windows 10 Enterprise
  • SonarLint plugin version: 7.0.0.74072
  • Programming language you’re coding in: C#
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): SonarQube Enterprise Edition - Version 8.9.8 (build 54436)

In visual studio 2022 enterprise addition I’ve set up the Connection Mode to SonarQube. I created a token and I’ve used it to connect successfully. I then close Visual Studio 2022 then reopen Visual Studio 2022 the Connection Mode is giving an error “Cannot connect to the SonarQube server. Make sure you provided the correct connection information, including your sign-in credentials, and try again.
See more information in the output window (SonarLint).”

I can then reenter the the token re-establish connection. I would expect that this should just reconnect without issue.

I also updated the settings.json file to be without avail.

{
  "sonarlint.rules": {},
  "sonarlint.connectedMode.connections.sonarqube": [
    {
      "connectionId": "XXXXXX", // id of your sonarqube server
      "serverUrl": "https://sonar.XXXXXX.com/", // url of your sonarqube server
      "token": "XXXXXXXX" // token to authenticate with sonarqube}],
    }
  ]
}

Any thoughts on a way to fix this?

Output window results for SonarLint:
Initializing the telemetry package…
Loaded settings from “C:\Users\XXXXXXX\AppData\Roaming\SonarLint for Visual Studio\settings.json”.
No open solution or folder
Current VS version:
Visual Studio Enterprise 2022
17.6.33829.357
17.6.5
Finished initializing the telemetry package…
Initializing the daemon package…
[Open in IDE] Creating request listener…
[Open in IDE] Checking availability of port 64120
[Open in IDE] Request listener created successfully. Listening on port 64120.
Connecting to SonarQube server: https://sonar.XXXXXXX.com/
Connecting to SonarQube server: Validating credentials
Connecting to ‘https://sonar.XXXXXXX.com/’.
[ConnectedMode] Initializing package…
[ConnectedMode] Package initialized
ERROR: The service is expected to be connected.
[Suppressions] Fetching all suppressions…
[Taint] Initializing taint issues synchronization package…
[Taint] Unable to fetch taint vulnerabilities: a connection to the server is not yet established.
[Taint] Finished initializing taint issues synchronization package.
Connected to SonarQube ‘8.9.8.54436’.
ERROR: The service is expected to be connected.
[Suppressions] Fetch operation failed: This operation expects the service to be connected.
Finished initializing the daemon package.
SonarQube request failed: Invalid credentials
Connecting to SonarQube server: Failed
Disconnecting…

Hi,

Welcome to the community!

You’re connecting the very latest version of SonarLint for Visual Studio to an outdated, EOL version of SonarQube. I know we did a lot of work in the SonarQube 9-series to improve support for connected mode (among other things), so I’m not surprised you’re experiencing flakiness. I wouldn’t be surprised if some of the APIs have changed.

Can you get your SonarQube admins to upgrade your instance and try again?

 
Ann