Seeing an error "Error fetching component measures: API GET '/api/measures/component' failed

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps): Azure DevOps

  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI): Azure DevOps

  • Languages of the repository: .NET

  • Issue Description:

We are seeing the error

"SonarQube Cloud: Error fetching component measures: API GET '/api/measures/component' failed. Error message: Request failed with status code 404" 

while publishing quality gate results. Although it is not affecting actual pipeline implementation, but seeing this error in the log is confusing.

The complete log of error is as below:

2026-04-13T14:36:43.7989143Z ##[section]Starting: Publish Quality Gate Result
2026-04-13T14:36:43.7998273Z ==============================================================================
2026-04-13T14:36:43.7998391Z Task : Publish Quality Gate Result
2026-04-13T14:36:43.7998464Z Description : Publish SonarQube Cloud's Quality Gate result on the Azure Pipelines build result. To be used after the actual analysis.
2026-04-13T14:36:43.7998583Z Version : 3.4.3
2026-04-13T14:36:43.7998649Z Author : sonarsource
2026-04-13T14:36:43.7998710Z Help : [More Information]( Azure DevOps Extension | SonarQube Cloud | Sonar Documentation )
2026-04-13T14:36:43.7998974Z ==============================================================================
2026-04-13T14:36:44.4468342Z [INFO] SonarQube Cloud: Server version: 8.0.0.85244
2026-04-13T14:36:44.7517975Z [INFO] SonarQube Cloud: Task AZ2HRfBUy-eFvxMt43Z3 completed
2026-04-13T14:36:45.1543050Z [INFO] SonarQube Cloud: Error fetching component measures: API GET '/api/measures/component' failed. Error message: Request failed with status code 404.
2026-04-13T14:36:45.1890675Z [INFO] SonarQube Cloud: Overall Quality Gate status: ok
2026-04-13T14:36:45.4335398Z ##[section]Finishing: Publish Quality Gate Result

Please guide us further on resolving the same. Thanks

Hi,

Can you share how this step is configured? My first thought is that it’s a permissions error in disguise.

 
Ann

Hi @ganncamp Greetings of the day!

We have created SOT in SonarCloud and provided that SOT in ADO service connection and below is pipeline configuration. Please let me know if you need any further details

steps:
  - ${{ if eq(parameters.enabled, true) }}:
    - task: SonarCloudPrepare@3
      displayName: 'Prepare SonarCloud Config'
      inputs:
        SonarCloud: '$(sonarCloudServiceConnection)'
        organization: '$(sonarCloudOrganization)'
        scannerMode: 'dotnet'
        projectKey: '$(sonarCloudProjectKey)'
        projectName: '$(sonarCloudProjectName)'
        extraProperties: |
          sonar.inclusions=$(sonarCloudInclusions)
          sonar.exclusions=$(sonarCloudExclusions)
          sonar.coverage.exclusions=$(sonarCloudCoverageExclusions)
      sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/**/*.coveragexml,$(System.DefaultWorkingDirectory)/TestResults/**/*.coveragexml
          sonar.project.monorepo.enabled=true
   
   - template: build-tasks/build-solution.yml

    # Runs NUnit tests via VSTest with optional code coverage collection
   - template: build-tasks/run-tests.yml
     parameters:
        enabled: ${{ parameters.runTests }}
        codeCoverageEnabled: ${{ parameters.codeCoverageEnabled }}

   - ${{ if eq(parameters.enabled, true) }}:
    - task: SonarCloudAnalyze@3
      displayName: 'Run SonarCloud Analysis'

   - ${{ if eq(parameters.enabled, true) }}:
    - task: SonarCloudPublish@3
      displayName: 'Publish Quality Gate Result'
      inputs:
        pollingTimeoutSec: '600'

Hi,

It looks like 4.2.3 is the current version of the extension. Can you update and try again?

 
Thx,
Ann

Hi @ganncamp - Sure will test and update you further

Hi @ganncamp - We tried current version i.e. 4.2.3, but the error is still there. Please find attached the logs

Sonarcloud_Log_21042026.zip (13.2 KB)

Hi,

Thanks for the log. Nothing’s jumping out at me from it.

I suspect your $(sonarCloudServiceConnection) context (including token) isn’t making it into the Quality Gate scope.

The only real difference I see between your configuration and what’s in the docs is the conditional in your:

That doesn’t seem like it should have an impact, but can you try it without that just to make sure, please?

 
Thx,
Ann

Hi @ganncamp ,

I tried without - ${{ if eq(parameters.enabled, true) }}: this condition, but still the same error

Hi,

Thanks for trying. Are your runners self-hosted? Behind “helpful” network devices?

 
Thx,
Ann

Hi @ganncamp

Sorry for the delayed response. We are using MS hosted runners for our sonarcloud and build pipelines

Hi,

It’s been a while since we started this thread. Are you still getting this error?

 
Thx,
Ann

Hi @ganncamp - Yes, we are still getting this error

Hi,

I"m not sure where to go from here. I’m going to have to flag this for more expert eyes.

 
Ann

Hi @ganncamp - Any further updates on the above issue?

Hi,

This is flagged for the team. Hopefully they’ll be along soon.

 
Ann