Not able to get the status of project even if it exists

Using the CI/CD of github action we are trying to analysis the projects code.
Able to see projects are getting analysed in the sonarcloud but when trying to get the status from the github action(sonar.qualitygate.wait=true) we are getting the below error.

INFO: EXECUTION FAILURE
INFO: Total time: 50.188s
INFO: Final Memory: 37M/127M
ERROR: Error during SonarScanner execution
ERROR: Failed to get Quality Gate status - Project doesn’t exist

Note:

  1. We are using the correct project key & organization too if not it will not be analysed in sonarcloud.
  2. we are using the sonarcloud analysing plugin i.e sonarsource/sonarcloud-github-action@master i.e GitHub - SonarSource/sonarcloud-github-action: Integrate SonarCloud code analysis to GitHub Actions

Hey there.

Can you share the configuration of your GitHub Actions YAML file?

Hope you are asking about the the sonar properties configuration. If yes, then please see the below

sonar.projectVersion=1.0.0-f29a22f7
sonar.host.url=https://sonarcloud.io
sonar.organization={{organizationkey}}
sonar.projectKey={{projectkey}}
sonar.projectName={{projectname}}
sonar.sources=.
sonar.tests=.
sonar.test.inclusions=Test/Unit/**
sonar.coverage.exclusions=view/**
sonar.language=php
sonar.sourceEncoding=UTF-8
sonar.php.tests.reportPath=reports/test-report.xml
sonar.php.coverage.reportPaths=reports/coverage-report.clover
sonar.scm.disabled=true
sonar.exclusions=_CI/**,Test/**,reports/**,registration.php,*.json
sonar.branch.name=bugfix/code-quality-fixes
sonar.qualitygate.wait=true
sonar.qualitygate.timeout=3000
sonar.verbose=true

Apart in the yaml file the below following thing been written for sonarcloud

- name: Sonar Analyze
  uses: sonarsource/sonarcloud-github-action@master
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Hope the above answer your query. But if there is any concerns then please let me know

Many thanks

Thanks.

To be honest, your project looks a bit over-configured. The following parameters wouldn’t be reccomended when using GitHub Actions (because they’re auto-detected, don’t exist, or have an alternative)

Does the project that you’re trying to analyze already exist in SonarCloud when you trigger the scan?

Okay colin. But I think that doesn’t create any issue. Also the project exists before triggering the pipeline that is the reason we can see the analysis report in the in the sonar cloud dashboard too.
Also the same configuration works for other project too. The issues started to come recently for the new project.
It would be great if we can do a call over this rather than going forth & back.
Also, as our account is paid one can we get premium support on it as we need to resolve this Asap

Today I tried the same setting:

-d:sonar.qualitygate.wait=true

Using dotnet-sonarscanner and also get “Project doesn’t exist.” In the scanners end phase.

Setting it to false finishes the action successfully.

This is the full config:

    - name: SonarQube begin
      run: |
        dotnet-sonarscanner begin \
        -o:${{ env.SONAR_ORG }} \
        -k:${{ env.SONAR_KEY }} \
        -n:${{ env.SONAR_NAME }} \
        -v:${{ env.GITVERSION_FULLSEMVER }} \
        -s:${{ github.workspace }}/SonarQube.Analysis.xml \
        -d:sonar.login=${{ secrets.SONAR_TOKEN }} \
        -d:sonar.qualitygate.wait=true

And this is the output of this step

    - name: SonarQube end
      run: |
        dotnet-sonarscanner end \
        -d:sonar.login="${{ secrets.SONAR_TOKEN }}"
INFO: Analysis report generated in 362ms, dir size=374 KB
INFO: Analysis report compressed in 62ms, zip size=106 KB
INFO: Analysis report uploaded in 834ms
INFO: Sensor cache published successfully
INFO: ------------- Check Quality Gate status
INFO: Waiting for the analysis report to be processed (max 300s)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 39.018s
INFO: Final Memory: 36M/120M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Failed to get Quality Gate status - Project doesn't exist

And this is uploaded before the action fails the quality gate.

So, it means everyone getting the same issue. Colin, if someone from your side can check and let us know why this issue happening?

Can I get any update on the above things?

Hey there.

I’m not able to reproduce this issue, at least on a public project in SonarCloud.

@alwin_joseph and @mrt181 do you experience this issue on public or private projects?

Private projects.

I am also getting in private projects. Also, note for old projects with same configuration it is working fine. For newly created projects only we are getting issues.

Have done some debugging and able to see the below following things. As you can see we can’t able to get the project status, giving 404 error. So, I guess there is some issue with the
sonarsource/sonarcloud-github-action module

05:25:09.949 DEBUG: GET 200 https://sonarcloud.io/api/ce/task?id=AYbo4Qxx_f4VFlD7kZLJ | time=783ms
05:25:15.122 DEBUG: GET 200 https://sonarcloud.io/api/ce/task?id=AYbo4Qxx_f4VFlD7kZLJ | time=166ms
05:25:15.283 DEBUG: GET 404 https://sonarcloud.io/api/qualitygates/project_status?analysisId=AYbo4Q5UzJdWvyk_oh3V | time=160ms
05:25:15.289 DEBUG: eslint-bridge server will shutdown
05:25:20.292 DEBUG: eslint-bridge server closed

Thanks. I’ve passed this on to the relevant team.

Thanks colin, But May I know when we can get an update on this ticket.

Any update on this?

Hey there.

Please don’t continually bump threads. We’ve asked an expert to take a look, and it can take some time. Your patience is appreciated.

Hi @alwin_joseph ,

I can see the login the ’ https://sonarcloud.io/api/qualitygates’ call was submitted with is getting a 404.
I would suggest checking the project-level permissions for your project and compare with a successful one.

@AlxO After adding the sonar.qualitygate.wait=true we always getting the same issue for all the projects. Could you please let us know which configuration can go wrong here?
Also, is the same thing is working for your private repositories?

Many thanks!

@alwin_joseph

Can you share the permissions you see defined at the project level for the user that is submitting these API calls?

@AlxO Sorry for the late message. Was suffering from fever. Just adding the below screenshot of our project permission. Hope the below things gives and proper insight on the permission.

Can you please check the let us know the recent updates on the above issue.