cache: macos: gtar: permission denied
I am getting the following failures on macos:
/usr/local/bin/gtar --use-compress-program zstd -d -xf /Users/runner/work/_temp/7c5a86f9-4e5e-4c50-b515-6b18d6fcacbe/cache.tzst -P -C /Users/runner/work/perkeep/perkeep
/usr/local/bin/gtar: Ignoring unknown extended header keyword 'LIBARCHIVE.creationtime'
/usr/local/bin/gtar: Ignoring unknown extended header keyword 'LIBARCHIVE.creationtime'
/usr/local/bin/gtar: Ignoring unknown extended header keyword 'LIBARCHIVE.creationtime'
/usr/local/bin/gtar: Ignoring unknown extended header keyword 'LIBARCHIVE.creationtime'
/usr/local/bin/gtar: Ignoring unknown extended header keyword 'LIBARCHIVE.creationtime'
Error: /usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/media/heif/dumpheif/dumpheif.go: Cannot open: Permission denied
/usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/media/heif/testdata/park.heic: Cannot open: Permission denied
/usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/media/heif/testdata/rotate.heic: Cannot open: Permission denied
Error: /usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/errorutil/highlight.go: Cannot open: Permission denied
Error: /usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/legal/legal.go: Cannot open: Permission denied
Error: /usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/legal/legal_test.go: Cannot open: Permission denied
Error: /usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/fault/fault.go: Cannot open: Permission denied
Error: /usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/syncutil/once_test.go: Cannot open: Permission denied
/usr/local/bin/gtar: ../../../go/pkg/mod/go4.org@v0.0.0-20190218023631-ce4c26f7be8e/syncutil/singleflight: Cannot mkdir: Permission denied
Using cache like so:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
Looks similar to https://github.com/actions/cache/issues/133 ?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 8
- Comments: 25 (9 by maintainers)
Links to this issue
Commits related to this issue
- go-mastodon: rollback to 0.0.4 The author has removed the 0.0.5 tag. Revert to 0.0.4 until this is explained: - https://github.com/mattn/go-mastodon/issues/133 I've also had to disable cache on mac... — committed to perkeep/perkeep by aviau 3 years ago
- go-mastodon: rollback to 0.0.4 The author has removed the 0.0.5 tag (and commits). Revert to 0.0.4 until this is explained: - https://github.com/mattn/go-mastodon/issues/133 I've also had to disabl... — committed to perkeep/perkeep by aviau 3 years ago
- build: disable go build cache on macOS to work around actions bug See: https://github.com/actions/cache/issues/527 — committed to rclone/rclone by ncw 3 years ago
- go-mastodon: rollback to 0.0.4 The author has removed the 0.0.5 tag (and commits). Revert to 0.0.4 until this is explained: - https://github.com/mattn/go-mastodon/issues/133 I've also had to change... — committed to perkeep/perkeep by aviau 3 years ago
- go-mastodon: rollback to 0.0.4 The author has removed the 0.0.5 tag (and commits). Revert to 0.0.4 until this is explained: - https://github.com/mattn/go-mastodon/issues/133 I've also had to change... — committed to perkeep/perkeep by aviau 3 years ago
- go-mastodon: rollback to 0.0.4 The author has removed the 0.0.5 tag (and commits). Revert to 0.0.4 until this is explained: - https://github.com/mattn/go-mastodon/issues/133 I've also had to change... — committed to perkeep/perkeep by aviau 3 years ago
- go-mastodon: rollback to 0.0.4 The author has removed the 0.0.5 tag (and commits). Revert to 0.0.4 until this is explained: - https://github.com/mattn/go-mastodon/issues/133 I've also had to change... — committed to perkeep/perkeep by aviau 3 years ago
- pin to 2.1.3 2.1.4 attempts to use GNU tar on mac OS agents however it is not working and throwing errors. See actions/cache#527 — committed to cloudflare/terraform-provider-cloudflare by jacobbednarz 3 years ago
- pin to 2.1.3 2.1.4 attempts to use GNU tar on mac OS agents however it is not working and throwing errors. See actions/cache#527 — committed to cloudflare/cloudflare-go by jacobbednarz 3 years ago
- TEST whether actions/cache@v2.1.4 works around the backslash problem There is currently a problem with actions/cache@v2: when specifying a path that contains slashes, on Windows they are converted to... — committed to dscho/git by dscho 3 years ago
- ci(vs-build): use actions/cache@v2.1.4 to work around the backslash problem There is currently a problem with actions/cache@v2: when specifying a path that contains slashes (such as `compat/vcbuild/v... — committed to dscho/git by dscho 3 years ago
- ci(vs-build): use actions/cache@v2.1.4 to work around the backslash problem There is currently a problem with actions/cache@v2: when specifying a path that contains slashes (such as `compat/vcbuild/v... — committed to dscho/git by dscho 3 years ago
- ci(vs-build): use actions/cache@v2.1.4 to work around the backslash problem There is currently a problem with actions/cache@v2: when specifying a path that contains slashes (such as `compat/vcbuild/v... — committed to dscho/git by dscho 3 years ago
- Auto merge of #3801 - rust-lang:renovate/actions-cache-2.x, r=Turbo87 Update actions/cache action to v2.1.6 [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovateb... — committed to rust-lang/crates.io by bors 3 years ago
Merged and updated tags.
@v2
is now on@v2.1.5
.For the moment I’ve moved the
v2
tag back tov2.1.3
since this does seem like a pretty big error. This doesn’t follow our normal flow of having a rollingv2
tag that points to the latest tag but we’re making an exception for this. Pinning this issue for visibilityValidated the proposed fix with the mongocli repo:
@v2.1.3
) - https://github.com/dhadka/mongocli/actions/runs/734188204@v2.1.4
) - https://github.com/dhadka/mongocli/actions/runs/734198611@dhadka/update-1.0.7
) - https://github.com/dhadka/mongocli/actions/runs/734211647and rclone:
@v2.1.3
) - https://github.com/dhadka/rclone/actions/runs/734189339@v2.1.4
) - https://github.com/dhadka/rclone/actions/runs/734243868@dhadka/update-1.0.7
) - https://github.com/dhadka/rclone/actions/runs/734308718If anyone else wants to test the fix before we publish
actions/cache@v2.1.5
, change theuses
line in your workflow touses: actions/cache@dhadka/update-1.0.7
.What I meant by “Push out 2.1.4”, was to just move
v2
back to the commit that2.1.4
is pointing to (instead of2.1.3
like it is right now). There would be no release and new commits would be needed, just a tag update.We’ve never bumped up the
versionSalt
before so this would be new and it’s somewhat unknown just how disruptive or harmless this would be. Given the amount ofactions/cache
users, I’m steering more towards being cautious as breaking workflows or at least significantly slowing them down for a bit is never fun.@konradpabjan how about just bumping
versionSalt
? That would have the same effect as @twpayne suggests: avoiding the use of.tar
files that were created previously (read: that were created not bygtar
)…I agree it’s possible to detect which version of
tar
to use to restore the cache. That said, cache invalidation is a famously hard problem, and for correctness it’s generally better to invalidate a little too eagerly rather than risk re-using a stale value. Realistically, the version number ofactions/cache
changes rarely, so invalidating the cache when the version number changes is unlikely to be very costly.tl;dr: this affects Go projects. You need to do the following:
GOFLAGS=-modcacherw
environment variable in your builds on GitHub Actions.${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
to${{ runner.os }}-go1.16-${{ hashFiles('**/go.sum') }}
(note the change from-go-
to-go1.16-
) for example (any change in the cache key is fine).Background:
I’m also hitting this, also trying to cache Go modules.
Your suspicions are spot-on. By default
pkg/mod
exists and is write protected, see https://github.com/golang/go/issues/27161 for background info.You can override this by setting
GOFLAGS=-modcacherw
as described in thego mod
docs:That said, in my own experiments, setting
GOFLAGS=-modcacherw
in my workflow config withwas not sufficient – I still got the same error.
I think this is because
actions/cache
is downloading an existing tar file that was created whenpkg/mod
had read-only permissions.I could not find a way to clear the
actions/cache
cache, so I changed the cache key from${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
to${{ runner.os }}-go1.16-${{ hashFiles('**/go.sum') }}
(note the change from-go-
to-go1.16-
), and, with that change, both building from an empty and a populated cache succeeded.Refs https://github.com/twpayne/chezmoi/pull/1049