-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Summary
The CI workflow run 33424 fails because the actions/cache go-modules restore step aborts with numerous /usr/bin/tar: ... Cannot open: File exists errors, leaving go test unable to run and the test job to exit with code 1.
Failure Details
Root Cause Analysis
actions/cache is attempting to restore $GOMODCACHE before the test job runs, but /usr/bin/tar immediately fails because the destination already contains the same module files (github.com/charmbracelet/lipgloss, github.com/charmbracelet/x/ansi, etc.). The failure manifests as Failed to restore: "/usr/bin/tar" failed with error: ... exit code 2, which aborts the cache step and causes the subsequent go test invocation to finish with exit code 1.
Failed Jobs and Errors
- test –
actions/cache@v3restore step: repeatedCannot open: File existserrors for files under/home/runner/go/pkg/mod; final warningFailed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2and the job ends withProcess completed with exit code 1.
Investigation Findings
- Cache restore errors occur before any tests start, so module downloads never proceed beyond the failed tar extraction.
- The cache contents include files exactly matching what tar tries to create, so restore cannot overwrite the existing tree and aborts.
- The failure is deterministic for this run (run 33424) and prevents the Go test suite from executing.
Recommended Actions
- Clean or recreate the module cache directory before running
actions/cache(e.g.,rm -rf "$GOMODCACHE"prior to restore or configure the step to extract into an empty directory) so tar can create files without colliding with leftovers. - Consider tightening the cache key/paths (e.g., ensure each job uses a unique path or adds a timestamp suffix) to avoid overlapping cache restores running concurrently.
- Once the cache is cleared, re-run the workflow to verify the cache step succeeds and tests complete.
Prevention Strategies
- Validate the cache directory is empty before restoring (a preparatory
rm -rforgo clean -modcache), ensuringactions/cachenever encounters pre-existing module files. - Instrument the workflow to log
go env GOMODCACHEand the restore target so future investigations can quickly detect directory mismatches.
AI Team Self-Improvement
When a Go workflow fails during caching, immediately check /usr/bin/tar errors; if files already exist, clear $GOMODCACHE or run go clean -modcache before restoring so the cache extraction does not abort.
Historical Context
No previous investigations with the same Cannot open: File exists tar signature have been stored in the current cache.
AI generated by CI Failure Doctor
To add this workflow in your repository, run
gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d. See usage guide.
- expires on Feb 5, 2026, 12:56 AM UTC