We are currently experiencing problems to connect to SonarCloud, using VSCode due to timeout.
Sonarlint is configured, and we had to hardcode the organisation in the settings .json file.
Token is generated and updated via VSCode - Token Received response.
Then Save connection result in the timeout below for 4 different ip addresses returned.
Caused by: org.apache.hc.client5.http.HttpHostConnectException: Connect to https://sonarcloud.io:443 [SonarCloud…, SonarCloud…, sonarcloud.io/108.1…, SonarCloud…] failed: Connection timed out: getsockopt
We have tried setting the proxy in Environment Variables as well as within VSCode proxy and the result remain the same for the timeout.
I was on a support call with our security team to trace connectivity and it does not seem like the connection after Save Connection is triggered.
He was able to pick up the Generate token task which launched the web browser.
I’m a bit confused by how exactly you tried to set up the connection, as seems like you both hardcoded some settings, while also used the connection UI?
Several things to note:
You have an option to create a full connection manually, via VS Code USER settings.json by putting the following snipet in the file (filled in with actual data of course )
You can generate a SonarCloud token manually by going to SonarCloud > My Account > Security, and copy/paste the token in the above settings. Once the connection is established, SonarLint should prompt you to migrate this hard-coded token into a VS Code secure storage.
You might want to check out how to let SonarLint pick up your proxy settings in this post, not sure if this is what you tried already.
Hi @sophio.japharidze, Thanks I have implementing the config as per settings.json you referenced.
Also tried starting vscode using a proxy code --proxy-server=“http://proxyabc:80”.
Even went the route of setting proxy environment variables.
None of the above worked, so I suspect the problem being with VSCode itself, as I was able to use another IDE (IntelliJ) without issues to connect to SC.
Hi Sophio, Problem resolved thanks.
After numerous settings, config and installing latest jdk 17.
Resolved with adding “sonarlint.ls.vmargs”: “-Dhttps.proxyHost=…”
Is there a way to set different proxies for SonarQube and SonarCloud in the settings.json?
Hi @Gerrie, I’m glad to hear your problem is resolved!
Is there a way to set different proxies for SonarQube and SonarCloud in the settings.json?
Unfortunately, this is not yet possible Does your company use both SonarCloud and SonarQube or is it for a personal SonarQube/SonarCloud instance? Just trying to understand the use case better. In any case, I will flag this internally as a possible improvement for the product.