Failure to restore cache `Cannot mkdir: Permission denied`
See original GitHub issueDescription: This seems like another instance of https://github.com/actions/setup-node/issues/362, but it’s happening with github-hosted runners, and using yarn instead of npm, and actions/setup-node@v3 instead of v2.
At some point, the cache seems to have been corrupted, and now it fails on multiple PRs.
The java setup action also seems to have a similar issue https://github.com/actions/setup-node/issues/459 but I can’t guess if it’s related.
Action version: actions/setup-node@v3
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version: node v12.22.12 yarn v1.22.17
Repro steps:
This is happening in a private repo, whenever the action runs. It might have started happening after I tried to bump the ancient node version used there in a specific PR, but affecting unrelated ones.
The job is straightforward
unit_tests:
name: 'Unit tests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE_VERSION }}'
cache: 'yarn'
- uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ my-key }}
- name: Install dependencies
run: yarn install --ignore-optional --frozen-lockfile --non-interactive
- run: |
yarn test:ci
Expected behavior:
Cache is either restored or the job works as if there was a cache miss
Actual behavior: The job fails. Notice cache size is super tiny, which seems an indication that something else went wrong, but an invalid value is being propagated.
...
Cache Size: ~0 MB (388620 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/90ebc24d-4768-41bb-8796-16cffd952c1c/cache.tzst -P -C /home/runner/work/my-repo/my-repo
/usr/bin/tar: ../../../../home: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../home/runner/.cache/yarn/v6: Cannot mkdir: No such file or directory
/usr/bin/tar: ../../../../home: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../home/runner/.cache/yarn/v6/npm-tslib-2.4.0-7cecaa7f073ce680a05847aa77be941098f36dc3-integrity: Cannot mkdir: No such file or directory
/usr/bin/tar: ../../../../home: Cannot mkdir: Permission denied
....
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:5 (4 by maintainers)
Top GitHub Comments
Thank you for your suggestion, @riffraff, we will definitely investigate how to solve this issue! ❤️
Hi, @riffraff 👋 Thanks for this issue! We’ll take it under investigation and get back to you with updates.