SonarCloud Quality Gate Failing in Bitbucket Pipeline (Analysis with id \’None\’ is not found)

We are seeing below error in quality gates step when bitbucket pipeline was run .

Digest: sha256:67445e0f5cf6e73d6c983883d44dbcd3acc076a2a029cee98b196580e7f7c02c
Status: Downloaded newer image for sonarsource/sonarcloud-quality-gate:0.1.5
Quality Gate failed: Could not fetch quality gate status: b'{"errors":[{"msg":"Analysis with id \\u0027None\\u0027 is not found"}]}

Our pipeline script is as below:

image: maven:3.3.9
options:
  docker: true
  size: 2x
clone:
  depth: full
pipelines:
  branches:
    '{develop_devops}':
      - step:
          name: SonarQube analysis
          script:
          - pipe: sonarsource/sonarcloud-scan:1.3.0
      - step: &check-quality-gate-sonarcloud
          name: Check the Quality Gate on SonarCloud
          script:
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.5
  pull-requests:
    '**':
      - step:
          name: SonarQube analysis
          script:
          - pipe: sonarsource/sonarcloud-scan:1.2.1
definitions:
  services:
    docker:
      memory: 4096
  caches:
    sonar: ~/.sonar/cache

Please advise. Thank you in advance !

Hello,

Sorry for the late answer. Do you still have the issue ?

It seems like you have a java project using maven, seeing the image you use for your pipeline. You should know that the sonarcloud-scan pipe will be able to analyze java files. Instead you should add the org.sonarsource.scanner.maven:sonar-maven-plugin:sonar option to you maven command (like explained in the tutorial on SonarCloud when you import a project).
So your script for the analysis step should look like this:

script:
 - mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar