Error connecting to Sonarqube server

Please provide

  • Operating system: Ubuntu 22.04 (Virtual Machine)
  • SonarLint plugin version: 4.4.1
  • Programming language you’re coding in:
  • Is connected mode used: Trying to
    • Connected to SonarCloud or SonarQube (and which version): 9.9.1

And a thorough description of the problem / question:

Hello all, I am trying to add a connection to a sonarqube self-hosted instance (https://***/sonarqube), but whenever I enter the Server URL to generate the token, it says: “Incorrect URL or server is not available”. The output logs are the following:

Debug - 15:28:28.603] GET https://**********/sonarqube/api/system/status java.net.UnknownHostException: **********: Temporary failure in name resolution | failed after 47ms
[Error - 15:28:28.605] Internal error: java.net.UnknownHostException: **********: Temporary failure in name resolution
[Error - 15:28:28.605] java.util.concurrent.CompletionException: java.net.UnknownHostException: **********: Temporary failure in name resolution
              at java.base/java.util.concurrent.CompletableFuture.reportJoin(Unknown Source)
              at java.base/java.util.concurrent.CompletableFuture.join(Unknown Source)
              at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processResponse(ServerApiHelper.java:110)
              at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.rawGet(ServerApiHelper.java:95)
              at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.get(ServerApiHelper.java:72)
              at org.sonarsource.sonarlint.core.serverapi.system.SystemApi.lambda$getStatus$0(SystemApi.java:38)
              at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:243)
              at org.sonarsource.sonarlint.core.serverapi.system.SystemApi.getStatus(SystemApi.java:37)
              at org.sonarsource.sonarlint.core.TokenGeneratorHelper.doesServerSupportAutomaticUserTokenGeneration(TokenGeneratorHelper.java:86)
              at org.sonarsource.sonarlint.core.TokenGeneratorHelper.helpGenerateUserToken(TokenGeneratorHelper.java:63)
              at org.sonarsource.sonarlint.core.ConnectionService.helpGenerateUserToken(ConnectionService.java:186)
              at org.sonarsource.sonarlint.core.rpc.impl.ConnectionRpcServiceDelegate.lambda$helpGenerateUserToken$2(ConnectionRpcServiceDelegate.java:64)
              at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$0(AbstractRpcServiceDelegate.java:67)
              at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.withLogger(AbstractRpcServiceDelegate.java:133)
              at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$1(AbstractRpcServiceDelegate.java:65)
              at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
              at java.base/java.util.concurrent.CompletableFuture$Completion.run(Unknown Source)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
              at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: **********: Temporary failure in name resolution
              at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
              at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Unknown Source)
              at java.base/java.net.InetAddress$PlatformResolver.lookupByName(Unknown Source)
              at java.base/java.net.InetAddress.getAddressesFromNameService(Unknown Source)
              at java.base/java.net.InetAddress$NameServiceAddresses.get(Unknown Source)
              at java.base/java.net.InetAddress.getAllByName0(Unknown Source)
              at java.base/java.net.InetAddress.getAllByName(Unknown Source)
              at org.apache.hc.client5.http.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:43)
              at org.apache.hc.client5.http.impl.nio.MultihomeIOSessionRequester.connect(MultihomeIOSessionRequester.java:113)
              at org.apache.hc.client5.http.impl.nio.DefaultAsyncClientConnectionOperator.connect(DefaultAsyncClientConnectionOperator.java:100)
              at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager.connect(PoolingAsyncClientConnectionManager.java:450)
              at org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime.connectEndpoint(InternalHttpAsyncExecRuntime.java:216)
              at org.apache.hc.client5.http.impl.async.AsyncConnectExec.proceedToNextHop(AsyncConnectExec.java:201)
              at org.apache.hc.client5.http.impl.async.AsyncConnectExec.access$000(AsyncConnectExec.java:82)
              at org.apache.hc.client5.http.impl.async.AsyncConnectExec$1.completed(AsyncConnectExec.java:153)
              at org.apache.hc.client5.http.impl.async.AsyncConnectExec$1.completed(AsyncConnectExec.java:142)
              at org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime$1.completed(InternalHttpAsyncExecRuntime.java:119)
              at org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime$1.completed(InternalHttpAsyncExecRuntime.java:110)
              at org.apache.hc.core5.concurrent.BasicFuture.completed(BasicFuture.java:123)
              at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager$3$1.leaseCompleted(PoolingAsyncClientConnectionManager.java:329)
              at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager$3$1.completed(PoolingAsyncClientConnectionManager.java:314)
              at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager$3$1.completed(PoolingAsyncClientConnectionManager.java:274)
              at org.apache.hc.core5.concurrent.BasicFuture.completed(BasicFuture.java:123)
              at org.apache.hc.core5.pool.StrictConnPool.fireCallbacks(StrictConnPool.java:397)
              at org.apache.hc.core5.pool.StrictConnPool.lease(StrictConnPool.java:215)
              at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager$3.<init>(PoolingAsyncClientConnectionManager.java:271)
              at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager.lease(PoolingAsyncClientConnectionManager.java:266)
              at org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime.acquireEndpoint(InternalHttpAsyncExecRuntime.java:105)
              at org.apache.hc.client5.http.impl.async.AsyncConnectExec.execute(AsyncConnectExec.java:141)
              at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
              at org.apache.hc.client5.http.impl.async.AsyncProtocolExec.internalExecute(AsyncProtocolExec.java:207)
              at org.apache.hc.client5.http.impl.async.AsyncProtocolExec.execute(AsyncProtocolExec.java:172)
              at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
              at org.apache.hc.client5.http.impl.async.AsyncHttpRequestRetryExec.internalExecute(AsyncHttpRequestRetryExec.java:97)
              at org.apache.hc.client5.http.impl.async.AsyncHttpRequestRetryExec.execute(AsyncHttpRequestRetryExec.java:184)
              at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
              at org.apache.hc.client5.http.impl.async.AsyncRedirectExec.internalExecute(AsyncRedirectExec.java:112)
              at org.apache.hc.client5.http.impl.async.AsyncRedirectExec.execute(AsyncRedirectExec.java:278)
              at org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
              at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient.executeImmediate(InternalAbstractHttpAsyncClient.java:347)
              at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient.lambda$doExecute$0(InternalAbstractHttpAsyncClient.java:205)
              at org.apache.hc.core5.http.nio.support.BasicRequestProducer.sendRequest(BasicRequestProducer.java:93)
              at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient.doExecute(InternalAbstractHttpAsyncClient.java:178)
              at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:97)
              at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:107)
              at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:124)
              at org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:130)
              at org.sonarsource.sonarlint.core.http.ApacheHttpClientAdapter$CompletableFutureWrappingFuture.<init>(ApacheHttpClientAdapter.java:201)
              at org.sonarsource.sonarlint.core.http.ApacheHttpClientAdapter.executeAsync(ApacheHttpClientAdapter.java:251)
              at org.sonarsource.sonarlint.core.http.ApacheHttpClientAdapter.getAsync(ApacheHttpClientAdapter.java:86)
              at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.rawGet(ServerApiHelper.java:94)
              ...

To give some more context, I am behind a corporate proxy and I can connect normally to the server instance through Mozilla and also tried with curl:

curl --verbose --proxy 'http://company-proxy:port' 'https//*****/sonarqube/api/system/status'

resulting in JSON:
{“id”:**********, “version”:9.9.1, “status”: “UP”}user

Hello, welcome to the community! And thank you for reporting this.

We identified a regression in the way proxy-related properties are used for connected mode and we published a fix today with version 4.4.2.

Please do feel free to report back here if this new version does not fix the connectivity issue and we’ll do our best to troubleshoot it :slight_smile:

2 Likes

It worked like a charm! Thank you very much :blush:.

Pd: Just for the record, I still had to add some extra JVM arguments in Sonarlint VS Code settings to make it work (like discussed in this other thread):

-Dhttps.proxyHost=company-proxy -Dhttps.proxyPort=port
3 Likes