Skip to content

fix(ci): Prevent runner permission collisions in log uploader - #825

Merged
castler merged 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/ci-permission-denied-testlogs
Aug 3, 2026
Merged

fix(ci): Prevent runner permission collisions in log uploader#825
castler merged 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/ci-permission-denied-testlogs

Conversation

@ShoroukRamzy

Copy link
Copy Markdown
Contributor

Description
This PR resolves a persistent, global CI pipeline issue where parallel build configurations (e.g., TSAN, ASAN, various GCC versions)
frequently crash during the log-upload stage with a cp: cannot create regular file ... Permission denied error.

The Problem

  • The custom action upload_bazel_testlogs_on_failure was configured to copy failed test logs from all parallel jobs into a single
    shared folder on the virtual runner machine: /home/runner/work/_temp/bazel-failed-testlogs/.
  • Because these parallel jobs run under different user accounts/IDs (due to containerization and sandbox isolation), the first job that failed created the directory structure under its own user.
  • Subsequent parallel jobs attempting to write their logs to the same shared sub-directories were blocked by the OS with a Permission denied error.
  • Additionally, the uploader was scanning the global VM cache directories (/home/runner/.cache/bazel and /home/runner/.bazel), which belong to other repositories' builds on the VM, causing further permissions conflicts.

The Solution

  1. Directory Isolation: We make the temporary log directory completely unique for each parallel job by appending the job's unique artifact-name, github.run_id, and github.run_attempt to the path:
    OUTPUT_DIR="${RUNNER_TEMP}/bazel-testlogs-${{ inputs.artifact-name }}-${{ github.run_id }}-${{ github.run_attempt }}"`
    This isolates concurrent and historic builds completely.

  2. Search Root Restriction: We restrict SEARCH_ROOTS to scan only ${GITHUB_WORKSPACE} (following symlinks with find -L). This successfully finds and uploads 100% of the failed logs generated by the current build (including all compiled dependencies), while completely bypassing global VM caches and avoiding any external permission conflicts.

@ShoroukRamzy

Copy link
Copy Markdown
Contributor Author

Hi @crimson11 and @LittleHuba, Kindly check this CI fix. Thanks!

@ShoroukRamzy

ShoroukRamzy commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @crimson11 and @LittleHuba, Kindly check this CI fix. Thanks!
I got this issue while I was facing unit test failure on this #455

Run ./.github/actions/00_infrastructure/upload_bazel_testlogs_on_failure Collect Bazel test logs 1m 37s Run set -euo pipefail cp: cannot create regular file '/home/runner/work/_temp/bazel-failed-testlogs/home/runner/.bazel/execroot/_main/bazel-out/k8-fastbuild/testlogs/third_party/score_baselibs/containers_component/test.log': Permission denied Error: Process completed with exit code 1. Upload Bazel test logs artifact 2s Node 20 is being deprecated. This workflow is running with Node 24 by default. If you need to temporarily use Node 20, you can set the ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true environment variable. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ Run actions/upload-artifact@v4 (node:237476) [DEP0040] DeprecationWarning: The punycodemodule is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...to show where the warning was created) With the provided path, there will be 842 files uploaded Artifact name is valid! Root directory input is valid! Beginning upload of artifact content to blob storage (node:237476) [DEP0169] DeprecationWarning:url.parse()behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued forurl.parse()vulnerabilities. Uploaded bytes 1778902 Finished uploading artifact content to blob storage! SHA256 digest of uploaded artifact zip is 762f1ecd961b77bf96d989148294d095300bd3003e1cf62ea0e612d2fcab62db Finalizing artifact upload Artifact bazel-testlogs-gcc15.zip successfully finalized. Artifact ID 8850242598 Artifact bazel-testlogs-gcc15 has been successfully uploaded! Final size is 1778902 bytes. Artifact ID is 8850242598 Artifact download URL: https://github.com/eclipse-score/communication/actions/runs/30798127796/artifacts/8850242598

@castler
castler added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@castler
castler added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@castler
castler added this pull request to the merge queue Aug 3, 2026
Merged via the queue into eclipse-score:main with commit 0161210 Aug 3, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in COM - Communication FT Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants