Error 404 on https://api.sonarcloud.io/analysis/analyses when running SonarScanner

Título: Error 404 on https://api.sonarcloud.io/analysis/analyses when running SonarScanner locally (not from GitHub Actions)

Categoría: SonarQube Cloud


Body:

Environment:

  • SonarScanner CLI 4.8.0.2856 (also reproduced with Maven plugin sonar:sonar)
  • Scanner Engine downloaded from SonarCloud: sonarcloud-scanner-engine-12.18.0.2466-all.jar
  • Java 25.0.1 (also tested with Java 17)
  • Windows 11
  • SonarCloud organization: novopayment
  • Project: bound to GitHub (BOUND)

Problem:
When running SonarScanner locally (not from GitHub Actions), the analysis fails at the “Create analysis” step with HTTP 404 on POST https://api.sonarcloud.io/analysis/analyses.

The scanner sends this request:
CreateAnalysisRequest[
organizationKey=novopayment,
projectKey=novopayment_api-itsp-notification-core,
branchName=feature/NGT-4514-post-migration-j25,
referenceBranchId=ecbb3f8c-01f3-4291-a3fa-2dd5f4f4fdd5,
pullRequestKey=null
]
→ POST https://api.sonarcloud.io/analysis/analyses (229-byte body)
← 404 https://api.sonarcloud.io/analysis/analyses (0-byte body)

What works:

  • Analysis from GitHub Actions CI runs successfully on the same project
  • Read-only API calls (quality gates, issues, project list) work fine with the same token
  • The endpoint does exist: a direct curl POST with an incorrect body returns 400 “Invalid request body”, not 404

What doesn’t work:

  • sonar.region=us parameter does not resolve the issue
  • Removing sonar.branch.name does not resolve the issue
  • Clearing ~/.sonar/cache does not resolve the issue

Question:
Is local analysis no longer supported for GitHub-bound projects with the new scanner engine (12.18.x)? Or is there a missing permission/configuration required for the POST /analysis/analyses endpoint when running outside of a GitHub Actions context?


Hi,

First,

This is reeeeeally old. The current version is 8.0.1. You should upgrade.

Now, on to your actual question… This is a permissions issue. It looks like GitHub Actions is set up with a valid token and your local attempts are not.

And why run locally when this is set up and running fine in your CI?

 
Ann