Timeout when publishing results

We are switching from SonarQube to SonarCloud and I’m working on getting our Azure DevOps pipelines working. My current challenge is getting the SonarCloudPublish working:

    - task: SonarCloudPublish@1
      displayName: 'SonarCloud publish'
      inputs:
        pollingTimeoutSec: '300'

The error that occurs:

##[error][SQ] Could not fetch metrics
##[error][SQ] API GET '/api/metrics/search' failed, error was: {"errno":"ETIMEDOUT","code":"ETIMEDOUT","syscall":"connect","address":"52.28.41.88","port":443}
##[error][SQ] API GET '/api/server/version' failed, error was: {"errno":"ETIMEDOUT","code":"ETIMEDOUT","syscall":"connect","address":"52.28.41.88","port":443}

I have already setup the proxy in the job’s variables section, which fixed the SonarCloudAnalyze task.

  variables:
    SONAR_SCANNER_OPTS: -Dhttps.proxyHost=192.168.16.90 -Dhttps.proxyPort=80

Any help would be appreciated.

Edit:
When providing the proxy as HTTP_PROXY in the variables, an ECONNRESET error is returned.

  variables:
    SONAR_SCANNER_OPTS: -Dhttps.proxyHost=192.168.16.90 -Dhttps.proxyPort=80
    HTTPS_PROXY: https://192.168.16.90:80
    HTTP_PROXY: http://192.168.16.90:80
##[error][SQ] Could not fetch metrics
##[error][SQ] API GET '/api/metrics/search' failed, error was: {"code":"ECONNRESET"}
##[error][SQ] API GET '/api/server/version' failed, error was: {"code":"ECONNRESET"}

Hey there.

Just to make sure the very obvious thing is stated – from your build agents, SonarCloud (and more generally, the public internet) is not accessible unless reached through this proxy?

Exactly, a proxy is required to access the internet.

On system level, there is no proxy configured.
netsh winhttp show proxy

On user level, there is a proxy configured.
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

We have solved the issue. It turns out our proxy only supports http, so both HTTP_PROXY and HTTPS_PROXY should point to the same URL. Additionally, we provided credentials in the URL.

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