Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied when caching macports #629

Open
rami3l opened this issue Aug 28, 2021 · 10 comments
Open

Permission denied when caching macports #629

rami3l opened this issue Aug 28, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@rami3l
Copy link

rami3l commented Aug 28, 2021

Installing macports is a time-consuming part in my CI, so I guess backing up /opt/local will help:

- name: Cache MacPorts
  id: cache-macports
  uses: actions/cache@v2
  with:
    path: /opt/local/
    key: ${{ runner.os }}-macports-${{ hashFiles('macos_build.txt') }}

However, since #133 didn't accept using sudo tar, I got a long error log all about permissons:

Run actions/cache@v2
Received 138412032 of 255723896 (54.1%), 132.0 MBs/sec
Received 255723896 of 255723896 (100.0%), 105.3 MBs/sec
Cache Size: ~244 MB (255723896 B)
/usr/local/bin/gtar --use-compress-program zstd -d -xf /Users/runner/work/_temp/68ab3e83-d089-4f96-b645-0834881ca4e5/cache.tzst -P -C /Users/runner/work/pacaptr/pacaptr --delay-directory-restore
/usr/local/bin/gtar: ../../../../../opt/local: Cannot mkdir: Permission denied
/usr/local/bin/gtar: ../../../../../opt/local: Cannot mkdir: Permission denied

Is it possible to introduce some sort of sudo, or is there any workaround?

Thanks in advance!

@zhongfly
Copy link

zhongfly commented Oct 5, 2021

same problem like you,we need sudo

@john-shaffer
Copy link

I've pushed a sudo branch which is available via: uses: john-shaffer/cache@sudo-tar

@github-actions
Copy link

github-actions bot commented May 5, 2022

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

@github-actions github-actions bot added the stale label May 5, 2022
@john-shaffer
Copy link

Still needed

@achernya
Copy link

I was able to work around this issue by creating the following file in my repository as gtar:

#!/bin/sh
exec sudo /usr/local/bin/gtar.orig "$@"

and adding the following step to my job before the cache action:

    - name: "Install gtar wrapper"
      run: |
        sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
        sudo cp macosx/gtar /usr/local/bin/gtar
        sudo chmod +x /usr/local/bin/gtar

@rami3l
Copy link
Author

rami3l commented Mar 18, 2023

I've pushed a sudo branch which is available via: uses: john-shaffer/cache@sudo-tar

@john-shaffer Thanks a lot for your patch!

However, due to the deprecation of save-state, it might stop working at the end of March 2023.

Would you mind checking it out? 🙏

@john-shaffer
Copy link

@rami3l you can use uses: john-shaffer/cache@main

@github-actions
Copy link

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

@github-actions github-actions bot added the stale label Oct 11, 2023
@rami3l
Copy link
Author

rami3l commented Oct 11, 2023

Still needed.

@github-actions github-actions bot removed the stale label Oct 12, 2023
@aryairani
Copy link

Still needed. I installed Racket, which is slow, so I cached it; but I couldn't restore it.

/usr/bin/tar -z -xf /home/runner/work/_temp/dc080dc3-f635-4afc-a376-84446d4ae578/cache.tgz -P -C /home/runner/work/unison/unison
/usr/bin/tar: ../../../../../usr/bin/racket: Cannot open: Permission denied
/usr/bin/tar: ../../../../../usr/etc: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/etc/racket: Cannot mkdir: No such file or directory
/usr/bin/tar: ../../../../../usr/etc: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/etc/racket/config.rktd: Cannot open: No such file or directory
/usr/bin/tar: ../../../../../usr/include/racket: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/include/racket: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/include/racket/racketcsboot.h: Cannot open: No such file or directory
/usr/bin/tar: ../../../../../usr/include/racket: Cannot mkdir: Permission denied
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants