Analysis report rejected at submission when scanner token lacks Execute Analysis
0 reputation · 16 Dec 2022, 22:28 UTC
0 reputation · 16 Dec 2022, 22:28 UTC
A scanner run can complete local analysis yet import no issues because the server rejects the analysis report before it reaches the Compute Engine. The goal is to understand exactly which authorization gate causes that rejection and how it differs from anonymous UI access.
The failure occurs on the server-side report submission path behind the Web API, not in the language analyzers. A common assumption is that setting sonar.forceAuthentication=false allows credential-less analysis, but that setting only governs anonymous UI browsing; it does not grant permission to submit an analysis. Newer scanner lines favor sonar.token over the older sonar.login/sonar.password pair, and token expiry or rotation can silently break CI pipelines. Behavior varies across SonarQube versions and scanner editions, so defaults should be confirmed on a disposable instance.
Does sonar.forceAuthentication=false ever permit a scanner to submit an analysis report without a token, or is Execute Analysis strictly required regardless of that setting? When a token is present but submission still fails, is the authoritative rejection recorded in ce.log rather than only the scanner console? For CI pipelines, what is the operational trade-off between granting Execute Analysis to a shared service account versus issuing project-scoped analysis tokens with respect to blast radius and silent rotation failures?
sonar.forceAuthentication=false does not allow a scanner to submit an analysis report without a token. Execute Analysis is strictly required for report submission regardless of that setting. forceAuthentication only controls anonymous UI browsing.
When a token is present but submission still fails, the authoritative rejection is recorded in ce.log, the Compute Engine log. The scanner console shows a failure, but ce.log contains the definitive authorization decision.
For CI pipelines, a shared service account with Execute Analysis has a larger blast radius because one credential can submit to any project it can access. Project-scoped analysis tokens limit blast radius per project but create more points of rotation and a higher risk of silent pipeline failures when a token expires or is rotated.
The local analysis completes because analyzers run offline. Import is blocked at server-side report upload. Common causes are missing sonar.token, expired/rotated token, or a token/user that lacks Execute Analysis on that specific project. Newer scanner lines prefer sonar.token over sonar.login/sonar.password.
One missing diagnostic detail that changes the recommendation: SonarQube major version and whether the token in use is a user token or a project analysis token. The permission model and logging details differ between versions and token types.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.