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

Hi @akumbhar,

I suspect this is because you are using a token with no Browse permission on the project. Swapping the analysis token for a user token (or a token with Browse on the project) should work.

To confirm you could try turning on debug mode in your pipeline and you should see a message like this:

Unable to get measures. It is expected if you are not using a user token but instead a global or project analysis token.

Best

Hi @antoine.vinot Thanks for the response. Just to clarify — does this mean the SOT token currently does not have Browse permission on the project?

Also, if we switch to a user-specific token to work around this, would that introduce a dependency on individual users (e.g., ownership, access continuity, offboarding risks), as opposed to using SOT which is more service-oriented?

Ideally, we’d want to avoid tight coupling to specific users if possible, so just checking whether granting Browse permission to SOT would be the preferred approach here.

Hi @akumbhar

does this mean the SOT token currently does not have Browse permission on the project?

Yes, as you can find out in our SOT documentation:

Scope Organization Tokens can only be granted the Execute analysis permission. Support for additional permissions is planned for the near future.

and

Scope Organization Tokens are not yet supported with Azure DevOps service connections.

if we switch to a user-specific token to work around this, would that introduce a dependency on individual users

Yes, it will introduce a coupling with the user who created it. To avoid access continuity risks, the workaround would be to create a technical user instead.

That being said, please note that this isn’t actually an error, but rather an INFO log indicating a failed API call. The quality gate itself still functions correctly; the only visible side effect is that the build summary won’t display per-metric rows (such as new violations, coverage, or duplications).
On our end, we could downgrade this to a DEBUG log to avoid confusion.

Best

Hi @antoine.vinot Thanks for the quick response.

If support for additional permissions for the SOT is planned in the near future, and the current error does not impact the quality gate analysis, we would prefer to continue using the SOT.

Additionally, it would be helpful if the log level for this message could be downgraded to DEBUG just to avoid confusion.

@akumbhar

Sounds good! I’ll track a task for us to lower the log level. Thanks for your patience while we get this rolled out.

Best