SonarLint can't access SonarQube instance in connected mode behind proxy

  • Ubuntu 20.04
  • VSCode 1.71.0
  • SonarLint 3.9.0

When setting up connected mode, I can’t connect to the server. Our SonarQube instance is running in the cloud, so that we need a proxy, which is running at http://127.0.0.1:3128 to connect to the service.

HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, are all configured.

curl can access the SonarQube instance.

SonarLint has the following error message in the logs:
Caused by: java.net.UnknownHostException: : Name or service not known

Since host resolution works with curl, this seems to be an issue that sonarlint does not support proxy servers.

I can also not find any proxy settings for sonarlint to configure it directly.

Maybe setting useSystemProxies in the plugin would help:

I found a solution/workaround. By setting JAVA_TOOL_OPTIONS=-Djava.net.useSystemProxies=true in /etc/environment I could get the plugin to connect to our server.

However I would still like this to a) be addressed in the readme, and b) the plugin should have a configuration option to use the proxy when starting the java process to use the configured proxies.

I’m guessing function languageServerCommand in extension.ts:130 would be the right place to address this properly.

1 Like