Intermittent issues being experienced with Azure DevOps Pipeline

Over the past week we have been receiving intermittent errors from SonarCloud from our Azure DevOps pipelines.

We use the inbuilt Sonar tasks within our yaml pipelines, including:

  - task: SonarCloudPrepare@3
	displayName: Initialise SonarCloud
	inputs:
	  SonarCloud: 'SonarCloud'
	  organization: {organisation}
	  scannerMode: 'dotnet'
	  ProjectKey: ${{ parameters.sonarcloud_project_key }}
	  ProjectName: ${{ parameters.sonarcloud_project_name }}
	  extraProperties: ${{ parameters.sonarcloud_properties }}

and:

  - task: SonarCloudPublish@3
	displayName: 'Publish SonarCloud results to azdo'
	condition: succeededOrFailed()
	inputs:
	  pollingTimeoutSec: '300'

The errors we are receiving intermittently are:

Initialise SonarCloud:

##[debug][DEBUG] SonarQube Cloud: API GET: '/api/server/version' with full URL "https://sonarcloud.io/api/server/version" and query "undefined"
##[debug][DEBUG] SonarQube Cloud: API GET '/api/server/version' failed. Error message: .
##[error][ERROR] SonarQube Cloud: Error while executing task Prepare: API GET '/api/server/version' failed. Error message: .
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;][ERROR] SonarQube Cloud: Error while executing task Prepare: API GET '/api/server/version' failed. Error message: .
##[debug]task result: Failed
##[error]API GET '/api/server/version' failed. Error message: .

Publish SonarCloud results to azdo:

##[debug][DEBUG] SonarQube Cloud: API GET: '/api/metrics/search' with full URL "https://sonarcloud.io/api/metrics/search" and query "{"f":"name","ps":"500"}"
##[debug][DEBUG] SonarQube Cloud: API GET '/api/metrics/search' failed. Error message: .
##[error][ERROR] SonarQube Cloud: API GET '/api/metrics/search' failed. Error message: .
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;][ERROR] SonarQube Cloud: API GET '/api/metrics/search' failed. Error message: .
##[error][ERROR] SonarQube Cloud: Error while executing task Publish: Could not fetch metrics
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;][ERROR] SonarQube Cloud: Error while executing task Publish: Could not fetch metrics
##[debug]task result: Failed
##[error]Could not fetch metrics
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;]Could not fetch metrics
##[debug]Processed: ##vso[task.complete result=Failed;]Could not fetch metrics

This does not happen every time the pipeline is run, as illustrated by the following two pipeline runs that occurred within minutes of each other:

The first run passed, whilst the second run failed on the Initialise SonarCloud step.

Can you please investigate regarding why we are experiencing these issues?

We have the same issue with our Azure Devops pipeline, about 2/3 of runs are failing.

Most errors are happing in the prepare step:

##[error][ERROR] SonarQube Cloud: Error while executing task Prepare: API GET '/api/server/version' failed. Error message: read ECONNRESET.
##[error]API GET '/api/server/version' failed. Error message: read ECONNRESET.

Sometimes when the prepare succeeds, the publish result step fails:

##[error][ERROR] SonarQube Cloud: API GET '/api/metrics/search' failed. Error message: Client network socket disconnected before secure TLS connection was established.
##[error][ERROR] SonarQube Cloud: Error while executing task Publish: Could not fetch metrics
##[error]Could not fetch metrics

Hi ! today our pipelines started failing when running the sonar tasks. Especially started failing the preparation of sonar, with a GET request to the version failed. The logs of the task do not log any error response nor status code.

The logs below are run with the debug-mode enabled so that we have the maximum logs possible

  • ALM used Azure DevOps
  • CI system used Azure DevOps
  • Prepare Analysis Configuration - Version 3.4.1
==============================================================================
Task         : Prepare Analysis Configuration
Description  : Prepare SonarQube Cloud analysis configuration
Version      : 3.4.1
Author       : sonarsource
Help         : [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
==============================================================================

  • Angular - TS
  • Error observed
##[debug][DEBUG] SonarQube Cloud: API GET: '/api/server/version' with full URL "https://sonarcloud.io/api/server/version" and query "undefined"
##[debug]Agent environment resources - Disk: / Available 17600.63 MB out of 74244.74 MB, Memory: Used 1207.00 MB out of 15995.00 MB, CPU: Usage 25.49%
##[debug][DEBUG] SonarQube Cloud: API GET '/api/server/version' failed. Error message: .
##[error][ERROR] SonarQube Cloud: Error while executing task Prepare: API GET '/api/server/version' failed. Error message: .
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;][ERROR] SonarQube Cloud: Error while executing task Prepare: API GET '/api/server/version' failed. Error message: .
##[debug]task result: Failed
##[error]API GET '/api/server/version' failed. Error message: .
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;]API GET '/api/server/version' failed. Error message: .
##[debug]Processed: ##vso[task.complete result=Failed;]API GET '/api/server/version' failed. Error message: .
Finishing: Prepare SonarCloud analysis

When requesting it manually works fine

This is how we define the task in our yaml pipeline

  - task: SonarCloudPrepare@3
    displayName: "Prepare SonarCloud analysis"
    inputs:
      SonarCloud: "SonarCloud"
      organization: "<here goes our org>"
      scannerMode: "CLI"
      configMode: "file"

Hey @mmonteirocl

I can’t reproduce the issue. Are you still facing it?

Hi @Colin ! Couple hours after I posted this started working again.

Then the day after failed inconsistently.

Now today we are facing again the same error. Seems to not be consistent the failure

What is more curious is that now it works for the “preparation of analisys” but it fais for the “publishing gate results”

It would be great if you could turn on DEBUG logging for a run (enable system diagnostics) and share what you get!

Hey everyone.

Thanks for the reports. I merged @mmonteirocl’s report from a few weeks ago which looks very similar. I am escalating this.

Any update on this issue?

we are still facing this issue across different Azure DevOps pipelines.

The issue appears when running SonarCloudPrepare@2 / SonarCloudPrepare@3 tasks, or SonarCloudPublish@2 / SonarCloudPublish@3 tasks.

It is intermittent, as in, does not show up on all pipeline runs (devs currently re-running pipelines until it works).
And we’ve ruled out network/FW as a source of the issue.

Current state of troubleshooting efforts:

  • Seems to only show up on pipelines using scannerMode: ‘CLI’, pipelines using scannerMode: ‘dotnet’ seem unaffected.

  • Forcing an older version of SonarScanner (cliScannerVersion: ‘5.0.2.4997’) didn’t resolve the issue as per this community link. Prepare Analysis Configuration Fails in version 6.3.2

(as the issue is intermittent, it’s hard to troubleshoot and be certain on solution attempts)

Please let us know if you have any suggestions on how to proceed.

Hey everyone.

Sorry for the delay here.

I expect that there is something strange going on with Node’s communication to SonarQube Cloud. NodeJS is used specifically in the Prepare (only when using the cli mode, rather than dotnet and Publish steps).

Can you confirm:

  • Are these self-hosted or Microsoft agents?
  • Which OS (agent pool) is being used?
  • What region are these agents in?
  • Are these self-hosted or Microsoft agents? Self-hosted

  • Which OS (agent pool) is being used? Linux

  • What region are these agents in? Australia East

Thanks, @ACCC-DF.

If you’re consistently encountering this issue, I’d like to determine whether it can be reproduced outside of the Azure DevOps tasks—for example, by performing a direct curl request from the agent.

You can try adding the following script to your Azure DevOps pipeline to check for transient connectivity issues. This will run the curl command multiple times, providing useful diagnostic output:

- script: |
    for i in {1..10}; do 
      echo "=== Attempt $i ==="; 
      curl -v --max-time 10 https://sonarcloud.io/api/server/version; 
      echo "Exit: $?"; 
      sleep 2; 
    done
  displayName: 'Test SonarCloud connectivity (10x)'
  continueOnError: true

What to look for in the results:

  • If the request fails intermittently, even outside the Azure task, it suggests an external connectivity or network issue.
  • If curl always succeeds but the Azure DevOps task fails, the problem is likely within the task or its configuration.

Gathering this data will help further diagnose the issue.

I ran that step multiple times in a new pipeline and all requests completed successfully:

< HTTP/2 200 
< content-type: text/plain
< content-length: 11
< date: Sun, 09 Nov 2025 21:24:31 GMT
< x-sonar-server-time: 1762723471738
< x-frame-options: DENY
< x-xss-protection: 1; mode=block
< x-content-type-options: nosniff
< content-security-policy-report-only: default-src 'self';script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.google-analytics.com https://www.googletagmanager.com https://tagmanager.google.com https://static.cdn.prismic.io https://bitbucket.org/atlassian-connect/all.js https://dev.azure.com js.braintreegateway.com assets.braintreegateway.com www.paypalobjects.com c.paypal.com https://static.userback.io;style-src 'self' 'unsafe-inline' https://tagmanager.google.com https://fonts.googleapis.com https://static.cdn.prismic.io https://static.userback.io;img-src 'self' https: assets.braintreegateway.com checkout.paypal.com data:;connect-src 'self' https://sonarcloud.io *.sc-dev.io https://*.google-analytics.com https://static.cdn.prismic.io https://*.sentry.io https://*.ingest.sentry.io https://sonarsource.cdn.prismic.io https://static.sonarcloud.io wss://notifications.sonarcloud.io https://d301sr5gafysq2.cloudfront.net api.sandbox.braintreegateway.com api.braintreegateway.com client-analytics.sandbox.braintreegateway.com client-analytics.braintreegateway.com *.braintree-api.com https://api.userback.io https://secure.gravatar.com https://api.bitbucket.org;object-src 'none';media-src 'none';child-src 'self' assets.braintreegateway.com c.paypal.com;frame-src 'self' assets.braintreegateway.com c.paypal.com *.cardinalcommerce.com https://eu.3ds.acssecure.com https://*.americanexpress.com https://acs.capitalone.com;font-src 'self' https://fonts.gstatic.com https://static.userback.io/fonts;
< strict-transport-security: max-age=31536000; includeSubDomains
< cache-control: no-cache, no-store, must-revalidate
< sonar-version: 13.2.0.3137
< x-cache: Miss from cloudfront
< via: 1.1 0ab8506d1bcb4c05dc5af58b02995a08.cloudfront.net (CloudFront)
< x-amz-cf-pop: CDG54-P1
< x-amz-cf-id: BFNlruEHFIcLwr5jd8-Giqa6dn2RElR8rHgc73oEglg7lWExqOSlKw==
< referrer-policy: strict-origin-when-cross-origin
< vary: Origin

I also tried the same using the /api/metrics/search endpoint and that worked as well.

Did you run them in the same pipeline as one where the request stemming from the Azure DevOps extension failed?