SonarQube in VSCode with custom quality profile

Hi,

I’ve created a custom Quality Profile in SonarQube by copying the “Sonar Way” PHP profile to give it a new name and do some rules changes for my project.

VSCode is confirmed in ConnectedMode for SonarQube and my project is also defined.

"sonarlint.connectedMode.connections.sonarqube": [
    {
        "serverUrl": "https://redacted.example.com/",
        "token": "REDACTED_TOKEN_HERE"
    }
],
"sonarlint.connectedMode.project": {
	"projectKey": "REDACTED_my_project_key_here"
}

When checking the debug output of the VS Extension, I see this:

Debug - 12:00:50.467] GET 200 https://redacted.example.com/api/qualityprofiles/search.protobuf?project=REDACTED_project_key | response time=17ms
[Debug - 12:00:50.467] Downloaded project quality profiles in 17ms
[Debug - 12:00:50.473] GET 200 https://redacted.example.com/api/settings/values.protobuf?component=REDACTED_project_key | response time=5ms
[Info  - 12:00:50.473] Downloaded settings in 5ms
[Debug - 12:00:50.475] Page downloaded in 2ms
[stderr] Apr. 10, 2021 12:00:50 P.M. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
[stderr] SEVERE: Internal error: java.lang.IllegalStateException: Project 'REDACTED_project_key' is associated to quality profile 'AXiyDD6fPBknjX93ygm5' that is not in the storage. The SonarQube server binding is probably outdated,  please update it.
[stderr] java.util.concurrent.CompletionException: java.lang.IllegalStateException: Project 'REDACTED_project_key' is associated to quality profile 'AXiyDD6fPBknjX93ygm5' that is not in the storage. The SonarQube server binding is probably outdated,  please update it.
[stderr] 	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)

That profile key is the correct one linked to that project.

What am I missing ? I’ve restarted VSCode but same result. And I’ve tried to see in SonarQube if there was something to toggle to share that profile, but I didn’t see it (might have missed that somewhere).

Any help would be appreciated !

Okay, found it, needs to hit CTLR+SHIFT+R and select SonarLint: Update all projects binding ...

I’ll let that here if it can avoid something from searching :wink:

2 Likes

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