Quality Gate failed: Could not fetch quality gate status: b'{"errors":[{"msg":"Analysis with id \\

We are facing a Quality Gate failure with the following error message:

Quality Gate failed: Could not fetch quality gate status: b’{“errors”:[{“msg”:“Analysis with id \”

We have already tried the following troubleshooting steps without success:

  • Reviewing Logs: We checked the SonarQube logs for any additional error messages or warnings, but the provided error message is the only information we have at the moment.

  • Analyzing Analysis: We examined the analysis being performed on the codebase to see if there were any issues with the project configuration or parameters. Everything appeared to be in order.

  • Checking Server Resources: We verified that the SonarQube server has sufficient resources (CPU, memory, disk space) to handle the analysis.

we have not been able to identify the root cause of this issue. As a result, we are reaching out to the Sonar community for assistance

If anyone has encountered a similar problem or has suggestions on how to resolve this Quality Gate issue, please share your experiences and insights with us. Your expertise could be invaluable in helping us resolve this problem and ensure the continued effectiveness of our code quality analysis.

Hi,

Welcome to the community!

What’s your DevOps platform? And can you share the id number?

 
Ann

Hi,

What do you mean by id number? Is it the project key or the organisation key or is it the error we received.?
This is the error we received.
✖ Quality Gate failed: Could not fetch quality gate status: b'{"errors":[{"msg":"Analysis with id \\u0027None\\u0027 is not found"}]}'

Hi,

I was asking for the ID mentioned in your error message:

 
Thx,
Ann

Hi,
This is the error we received
✖ Quality Gate failed: Could not fetch quality gate status: b'{"errors":[{"msg":"Analysis with id \\u0027None\\u0027 is not found"}]}'

Thanks

Hi,

We’re back to this, then:

Also, can you share your pipeline configuration looks like?

 
Ann

Hi

On our Bitbucket repositories, we presently use Sonar Cloud to scan files following a change or a pull request.
This is how our pipeline looks:

clone:
  depth: 2
options:
  docker: true
  size: 2x
definitions:
  services:
    docker:
      memory: 4096
  caches:
    sonar: ~/.sonar/cache
  steps:
    - step: &build-test-sonarcloud
        name: Build, test and analyze on SonarCloud
        size: 2x
        caches:
          - sonar
          - docker
        script:
          - pipe: sonarsource/sonarcloud-scan:2.0.0
        services:
          - docker
    - step: &check-quality-gate-sonarcloud
        name: Check the Quality Gate on SonarCloud
        size: 2x
        script:
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.6
        services:
          - docker
        caches:
          - docker
pipelines:
  branches:
    dev:
     - step: *build-test-sonarcloud
     - step: *check-quality-gate-sonarcloud
  pull-requests:
     '**':
       - step: *build-test-sonarcloud
       - step: *check-quality-gate-sonarcloud

Hi,

Thanks for sharing your pipeline.

I’m not finding a good example of how this is supposed to be configured (I’ll bring that up internally) but I believe you’re getting the error on the Quality Gate pipe because the working assumption is that the QG pipe will access data from the Analysis pipe to get that analysis id.

Can you put both pipes in the same script? I don’t have experience with Bitbucket, but the internet is telling me it’s possible to do that.

 
Ann

Hi,

Over 200 repositories currently use this pipeline, and it functions perfectly. This pipeline was also operating properly just a few days ago, but for some reason—which is unknown to us—it suddenly generated this error.

Hi,

Thanks for these additional details.

So a few days ago you got this error - for all projects, or just one run on one project?

 
Ann

Multiple runs on one project.

Hi,

Can you confirm it’s still happening? I’m going to flag this for the team, so I want to make sure there’s still something there to debug.

 
Thx,
Ann

hi,

Yes.It is still happening.

Thnx

1 Like

Hello,
Can you please provide your organization and project name so I can find logs of your analysis?

Hi,

Organization : emvigotechnologies
Project : dashboard
Branch : dev-phase2

Thnx

Hello,

To investigate further on your issue, we need additional information:

We need the logs produced during the scan too:

  • Enable the debug logs by adding DEBUG=true to your bitbucket-pipelines.yml More info
  • Post here the full logs (private elements may be masked)

Hi,
Analysis and sonar gate logs

sonargate.log (4.0 KB)
analysis.log (186.0 KB)

Thnx

Hi,

Could you kindly provide an update on our progress? Are there any additional details or further information needed?

Thnx

Hello,
Sorry for the late answer.

The issue is still under investigation.
Is this still happening?

Hi,

Yes, its still occurring.