Skip to content

ci: fix sonar-scanner working directory permission failure - #12

Merged
ameernexus1 merged 1 commit into
developfrom
ci/fix-sonar-scanner-workdir
Sep 3, 2026
Merged

ameernexus1 merged 1 commit into
developfrom
ci/fix-sonar-scanner-workdir

Conversation

@ameernexus1

Copy link
Copy Markdown
Collaborator

Build #8 failed the SonarQube Analysis stage with exit code 3

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>
@ameernexus1
ameernexus1 merged commit 04e0169 into develop Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant