Can't connect to SonarQube instance from VSCode

Hi,

I want to bind my VSCode with my SonarQube instance but i don’t know how to resolve my issue.

First, this is my settings.json from User Settings :

{
    "sonarlint.connectedMode.servers": [
        {
            "serverId": "my_server", // Connection identifier
            "serverUrl": "http://my.custom.sonar.instance.url/",
            "token": "MyGeneratedToken" 
        },
    ],
    "sonarlint.connectedMode.project": {
        "serverId": "my_server",
        "projectKey": "project_key_in_sonarqube"
    }
}

The problem is, when I save my configuration or launching the command Update SonarLint binding to SonarQube/SonarCloud, I always have these errors on VSCode :

  • Failed to update SonarLint server storage
  • Unable to process command 'SonarLint.UpdateServerStorage' Not authorized. Please check server credentials.

I tried to use different tokens & I don’t know what to do for now…

EDIT : I made some tests with Eclipse or Intellij & the result is the same, the token generated is rejected. Is there something to do about token (permissions or i don’t know) ?

Thanks all

Hi,

Is the user you have generated the token for allowed to see the project in SonarQube?

You can also have a look at the server access.log to find the exact WS call that is failing.

1 Like

I had to download the server certificate and import it to the cacerts keystore for java.