Error retrieving analysis: API GET '/api/qualitygates/project_status' failed

I’m getting this error on my “SonarCloudPublish” task in Azure DevOps pipelines.

##[error][ERROR] SonarQube Cloud: Error retrieving analysis: API GET '/api/qualitygates/project_status' failed. Error message: Request failed with status code 403.
##[error][ERROR] SonarQube Cloud: Error while executing task Publish: Could not fetch analysis for ID 'a8d95965-de3c-4128-b2d3-78393a2aa051'
##[error]Could not fetch analysis for ID 'a8d95965-de3c-4128-b2d3-78393a2aa051'

Here’s the yaml:

    - task: SonarCloudPublish@3
      displayName: 'Publish SonarCloud Results'
      inputs:
        pollingTimeoutSec: '300'

Does it matter that I’m on the free version of SonarQube and that I’m scanning a branch? However, the user (me) is an Administrator of the org and has the appropriate permissions.

Hey Joshua

Yes, this is why. Only scans of the main branch are supported on the Free plan.

It might be more user-friendly if we simply don’t compute the Quality Gate rather than issue a 403 here, and I’ll pass that along.

However, for now, it’s probably best to remove the SonarQubePublish step, at least for builds not targeting your main branch.

Do you have a paid plan for single developers? I am a single dev who doesn’t need to pay (nor can afford to pay) $100/mo for the team plan. I’ve been a user of SonarCloud for years (paying $10-$20/mo). Now, I’m looking to go elsewhere (potentially, DeepSource) as others have plans for individuals.

Yes. Not computing vs. returning a 403 is the difference between a working and non-working build. Returning a 403 breaks the build. Which means, I’d need to create duplicate pipelines - one with the publish, one without it.

Hey @a11smiles

There is still a $32 a month plan. Maybe you missed it because of an issue on our side:

Okay. I’ve purchased the $32/mo sub. Thanks for the fix.

And I can confirm that, once I purchased the sub, the authentication error was resolved. Thanks!

1 Like

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