ci: fix sonar-scanner working directory permission failure - #12
Merged
Merged
Conversation
Build #8 failed the SonarQube Analysis stage with exit code 3: Working dir: /tmp/.scannerwork Caused by: java.nio.file.AccessDeniedException: /tmp/.scannerwork/.sonartmp WARN: Unable to locate 'report-task.txt' in the workspace. The sonar-scanner-cli image bakes in /tmp/.scannerwork as its working directory, owned by scanner-cli (uid 1000) with mode drwxr-xr-- and so unwritable by others. The container runs as the Jenkins uid/gid so that files it writes into the workspace are not root-owned, which left the scanner unable to create its temp dir. Overriding sonar.working.directory into the bind-mounted workspace fixes both symptoms: the directory is writable (the workspace is jenkins-owned), and report-task.txt now lands in $WORKSPACE/.scannerwork where waitForQualityGate looks for it -- without it the Quality Gate stage had no analysis to poll. Also gitignores .scannerwork/ so local scanner runs stay untracked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build #8 failed the SonarQube Analysis stage with exit code 3