Issue with SonarQube Scan Action: 404 Error

  • SonarQube Version: 10.1

  • Deployment Method: Helm

  • I am currently using the following command in my GitHub Actions workflow:
    uses: sonarsource/sonarqube-scan-action@master
    However, I am encountering an error when trying to run the action. I am attaching a screenshot of the error message for your reference.
    sonarqube404error

The error indicates a 404 response when attempting to access the specified URL. I have confirmed that the SonarQube server is running and accessible at the provided URL, and I am attaching a screenshot to corroborate that.

Additionally, the token I am using is a global token, but when I run the following command:
curl -u my_token: "http://url/api/projects/search
I receive an “Insufficient privileges” error message. I am also attaching a screenshot of this error.

Could you assist me in troubleshooting these issues.

Hi,

Welcome to the community!

We’re really not fans of screenshots; they’re hard to read.

Based on the text of your post, I can only say that a 404 is kinda self-explanatory.

You may also find the docs helpful.

 
HTH,
Ann

Hi Ann,

I apologize for the screenshot in my previous message; I understand it may have been difficult to read. The link you provided is already familiar to us, and we are following it as documented. I would like to clarify the issue in more detail without relying on screenshots.

I have confirmed that the SonarQube server is running and accessible at the provided URL using the curl -u some_user:token "url/api/system/status" endpoint. Additionally, the token I am using is a global token. However, when I try to access the curl -u some_user:token "url/api/projects/search endpoint, I receive an “Insufficient privileges” error message.

I am currently using the following command in my GitHub Actions workflow:
uses: sonarsource/sonarqube-scan-action@master
However, I am encountering an error when trying to run the action. Could this be related to the LOC limit being crossed? The requested URL returned error: 404, and the following error messages I am getting:

Run sonarsource/sonarqube-quality-gate-action@master
with:
  scanMetadataReportFile: .scannerwork/report-task.txt
  pollingTimeoutSec: 300
env:
  SONAR_TOKEN: ***
  SONAR_HOST_URL: my_url

Run $GITHUB_ACTION_PATH/script/check-quality-gate.sh ".scannerwork/report-task.txt" "300"
$GITHUB_ACTION_PATH/script/check-quality-gate.sh ".scannerwork/report-task.txt" "300"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  SONAR_TOKEN: ***
  SONAR_HOST_URL: my_url

curl: (22) The requested URL returned error: 404
Error: Process completed with exit code 22.

Any guidance on how to resolve this would be greatly appreciated!

Best,
Rishi Ranjan

Hi Rishi,

Looking at the docs for that API, it says:

Requires ‘Administer System’ permission

Can I have the full text of the analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Thx,
Ann