Error binding workspace

Sonarlint.txt (13.0 KB)

Is it compatible for both sonarqube and sonarlint if I will install java 7?

Hello, thanks for the additional logs.

Could you please open a separate thread for your question about Java versions? Letā€™s try to focus on proxy settings on this thread.

I noticed in the user settings you shared that you used the following:

"sonarlint.ls.vmargs": "-Dhttps.proxyHost=http://9.xxx.xxx.xx -Dhttps.proxyPort=3128 -Dhttps.nonProxyHosts=localhost|127.0.0.1|http://9.xxx.xxx.xx"

As far as I can tell, https.nonProxyHosts is not a property supported by the Java network stack.

Could you please try with http.nonProxyHosts instead?

Additionally, could you please check what happens if you donā€™t set any proxy-related configuration?

Hi Jean,

Iā€™ve tried to change the proxy host to below configuration. But as tested the same error occured.

ā€œsonarlint.ls.vmargsā€: ā€œ-Dhttp.proxyHost=http://9.208.xxxx.xx -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts=localhost|127.0.0.1|http://9.208.xxx.xxā€,

This is the error that i am seeing. without proxy cofiguration.

[Error - 10:17:00.228] org.apache.hc.client5.http.HttpHostConnectException: Connect to https://xxxxx.cloud:443 [xxx.cloud/10.244.64.16, xxxxxx.cloud/10.244.64.29] failed: Connection timed out: no further information
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Unknown Source)
at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
at org.apache.hc.core5.reactor.InternalConnectChannel.onIOEvent(InternalConnectChannel.java:64)
at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178)
at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:86)
at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
at java.base/java.lang.Thread.run(Unknown Source)

[Debug - 10:17:00.228] Cannot connect to server event-stream, retrying in 120s

I have tried to test the connection without proxy and it went successful. Obviously the issue here is the proxy settings.

Hey, thanks for the additional info.

Could you please clarify what you mean by:

If the connection is successful without proxy settings, why try to set proxy settings in the first place?

As far as I can tell, if the only exception that you see in the logs is the one about the server event stream, then connected mode should mostly work fine, with the exception that changes on the server (e.g. changes in quality profile, transitions on issues) wonā€™t be reflected immediately in the IDE.

Hi Jean,

Itā€™s because our environment setup is using proxy settings for Sonarqube. Is the sonarlint compatible with connectinng with proxy? As it is the only issue here

Please let me know if you have any idea on the fix it would help.

Hello, at this stage we still donā€™t have any idea about what is going on: the exception message - Connection timed out: no further information - does not give much information to work with.

These kinds of issues are very hard to investigate because we cannot reproduce the exact environment that you have in terms of proxy settings, network routes, etc.

As far as I can tell, users on this community forum have been able to configure connected mode with a proxy in SonarLint for VSCode.

Could you please confirm that the proxy settings that you configured allow your development environment to reach the SonarQube server?

For instance, you could check that the serverā€™s status API can be queried with the following:

curl --verbose --proxy 'http://9.xx.xx.xx:3128' 'https://xxxx.cloud/api/system/status'

If it is successful, it will return a JSON object with the serverā€™s status and version. If not, the --verbose option should tell us more about what may be going on.

For the users who are able to configure sonarqube connected mode which proxy configuration did they used vscode as well?

We need to proceed by elimination to get to the root cause of the issue. So I would like to first understand whether the proxy settings that you are trying to use are valid for your network setup.

My line of thought is that if these proxy settings donā€™t work with another standard tool (like curl), there is no chance that they would work with SonarLint.

Can you please try the troubleshooting command I suggested above?

Hi Jean,

Below is the output of the command curl --verbose

root@DESKTOP-DEM92U2:/mnt/c/Users/BB23V7JPM/Desktop# curl --verbose --proxy 'http://9.208.145.97:3128' 'xxxx.cloud//api/system/status'
*   Trying x.xxx.145.97:3128...
* TCP_NODELAY set
* Connected to x.xxx.145.97 (x.xxx.145.97) port 3128 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to xxxx.cloud:443
> CONNECT xxxx.cloud:443 HTTP/1.1
> Host: sxxxx.cloud:443
> User-Agent: curl/7.68.0
> Proxy-Connection: Keep-Alive
>

Hello, thanks for the additional information.

If this is the only output that curl gives, I believe that the root cause of the issue is that this particular proxy does not permit access to your SonarQube server from your development environment.

My suggestion is that you first find proxy settings that allow curl to get an answer from the SonarQube server, and then we can have a look at how to tell SonarLint to use these working proxy settings.

Hi Jean,

Thank you for your feedback, but considering the result of the curl command isnā€™t it the connection is working from my local to proxy sonarqube. Because I can see connected status to proxy http.xxx.xx:3128

If the proxy settings were correct, a call to api/system/status would return a JSON object like this:

{"id":"XXXXXXXX-YYYYYYYYYYYYYYYYYYYY","version":"10.3.0.78469","status":"UP"}

I donā€™t see this in the output from curl that you shared above.

* Connected to x.xxx.xxx.97 (x.xxx.xxx.97) port 3128 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to xxx.cloud:443
> CONNECT xxx.cloud:443 HTTP/1.1
> Host: xxxx.cloud:443
> User-Agent: curl/7.68.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=xxxx.cloud
*  start date: Sep 22 06:35:07 2023 GMT
*  expire date: Dec 21 06:35:06 2023 GMT
*  subjectAltName: host "xxxx.cloud"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
> GET //api/system/status HTTP/1.1
> Host: xxxxx.cloud
> User-Agent: curl/7.68.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Mark bundle as not supporting multiuse
< HTTP/1.1 200
< x-frame-options: SAMEORIGIN
< strict-transport-security: max-age=31536000; includeSubDomains;
< x-xss-protection: 1; mode=block
< x-content-type-options: nosniff
< content-security-policy: default-src 'self'; base-uri 'none'; connect-src 'self' http: https:; img-src * data: blob:; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; worker-src 'none'
< x-content-security-policy: default-src 'self'; base-uri 'none'; connect-src 'self' http: https:; img-src * data: blob:; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; worker-src 'none'
< x-webkit-csp: default-src 'self'; base-uri 'none'; connect-src 'self' http: https:; img-src * data: blob:; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; worker-src 'none'
< cache-control: no-cache, no-store, must-revalidate
< vary: accept-encoding
< content-type: text/html;charset=utf-8
< content-length: 1850
< date: Mon, 25 Sep 2023 04:02:52 GMT
< set-cookie: 1ccd051cf64d4f985284f12c00a0751d=1c56a5a335315f76557f541288feed9c; path=/; HttpOnly; Secure; SameSite=None
<

<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="apple-touch-icon" href="/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/x-icon" href="/favicon.ico">
    <meta name="application-name" content="SonarQube" />
    <meta name="msapplication-TileColor" content="#FFFFFF" />
    <meta name="msapplication-TileImage" content="/mstile-512x512.png" />
    <title>SonarQube</title>

    <link rel="stylesheet" href="/js/outDLYDOPRS.css" />
</head>

<body>
    <div id="content">
        <div class="global-loading">
            <i class="spinner global-loading-spinner"></i>
            <span aria-live="polite" class="global-loading-text">Loading...</span>
        </div>
    </div>

    <script>
        window.baseUrl = '';
        window.serverStatus = 'UP';
        window.instance = 'SonarQube';
        window.official = true;
    </script>

    <script type="module" src="/js/outUEEFMTWC.js"></script>
</body>

</html>
* Connection #0 to host 9.208.145.97 left intact

Hi Jean,

Above thread is the complete result response using the curl commands.

The problem has been resolved. No help from this site.

Hello, glad to hear that you solved your issue!

Out of curiosity, what was the root cause? I believe it could benefit other users of SonarLint for VSCode who have a proxy setup similar to yours.

3 Likes