actions / actions/cache

Cannot mknod: Operation not permitted

Open
#1,429 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I ran into this issue trying to cache LXD containers. I had to change some file permissions because actions/cache was failing due to permission denied. Now, saving the cache works, but when I try to restore it, I get:

/usr/bin/tar -xf /opt/actions-runner/_work/_temp/f9c60f6d-08e1-489e-9f92-01f605b0ad76/cache.tzst -P -C /opt/actions-runner/_work/juju/juju --use-compress-program unzstd
/usr/bin/tar: ../../../../../var/snap/lxd/common/lxd/storage-pools/default/containers/snapcraft-juju/rootfs/dev/ptmx: Cannot mknod: Operation not permitted
...
/usr/bin/tar: Exiting with failure status due to previous errors
Warning: Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2

Full job logs here.

Here's the relevant part of my workflow.yml:

    - run: sudo chmod -R 0777 /var/snap/lxd/common/lxd

    - name: Cache build environment
      uses: actions/cache@v4
      with:
        path: '/var/snap/lxd/common/lxd/storage-pools/default/containers/snapcraft-juju'
        key: snapcraft-build-env-${{ runner.os }}

    - run: sudo chmod -R 0777 /var/snap/lxd/common/lxd

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the workflow.yml excerpt and the linked job logs, focusing on the actions/cache path, the restore command, and the reported tar mknod failure. Trace how the cache action handles this path during save and restore. Done means the LXD container cache restores without the reported tar failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.