question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure to restore cache `Cannot mkdir: Permission denied`

See original GitHub issue

Description: 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:closed
  • Created a year ago
  • Reactions:7
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
IvanZosimovcommented, Jun 2, 2022

Thank you for your suggestion, @riffraff, we will definitely investigate how to solve this issue! ❤️

1reaction
IvanZosimovcommented, Jun 1, 2022

Hi, @riffraff 👋 Thanks for this issue! We’ll take it under investigation and get back to you with updates.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission denied when restoring cache in CircleCi job
Solution that fixed it was simply changing the cache key. Such as from v1 prefix to v2 . This avoids attempting to restore...
Read more >
Permission denied when unpacking Cache - CircleCI Discuss
Hi everyone, I have a simple issue when trying to restore a cache of my Gemfiles. I am using the circleci/ruby-2.3 docker image...
Read more >
Bug #1320313 “permission denied mkdir /root/.cache”
I can successfully run every command that is reported as failed from ubuntu-emulator. mount report /dev/mapper/sda5_crypt on / type ext4 (rw, ...
Read more >
Error enabling page caching Can't create folder /wp-content ...
The topic 'Error enabling page caching Can't create folder /wp-content/cache/tmp: mkdir(): Permission denied' is closed to new replies.
Read more >
Troubleshoot Permission Issues - Bitnami Documentation
You can't upload a file via SFTP? If you see an error like this when uploading a file: [...] permission denied. Temporarily change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found