Repository navigation
Description
Hello, I have an issue regarding restoring caches on self hosted runners.
I am building the cache in a github runner, then in my self hosted runner, I am trying to restore it. I can see that the cache is actually being downloaded, but then when the tar command is running, it is failing to unpack it. Here's the log for it:
##[debug]Save intra-action state CACHE_KEY = ...e6f4
##[debug]Resolved Keys:
##[debug]["...e6f4"]
##[debug]Checking zstd --version
##[debug]*** zstd command line interface 64-bits v1.5.2, by Yann Collet ***
##[debug]Resource Url: url here
::add-mask::***
##[debug]Cache Result:
##[debug]{"scope":"refs/heads/dev","cacheKey":"...e6f4","cacheVersion":"...4fc88","creationTime":"2022-05-26T13:02:33.1933333Z","archiveLocation":"***"}
##[debug]Archive Path: /home/user/actions-runner/actions-runner/_work/_temp/...efdd/cache.tzst
##[debug]Use Azure SDK: true
##[debug]Download concurrency: 8
##[debug]Request timeout (ms): 30000
##[debug]Downloading segment at offset 0 with length 643139890...
Received 634751282 of 643139890 (98.7%), 40.3 MBs/sec
Received 643139890 of 643139890 (100.0%), 37.0 MBs/sec
Cache Size: ~613 MB (643139890 B) -> Cache downloaded
/usr/bin/tar --use-compress-program zstd -d -xf /home/user/actions-runner/actions-runner/_work/_temp/id/cache.tzst -P -C /home/user/actions-runner/actions-runner/_work/repo/repo
tar (child): zstd -d: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
/usr/bin/tar: Child returned status 2
/usr/bin/tar: Error is not recoverable: exiting now
Warning: Tar failed with error: The process '/usr/bin/tar' failed with exit code 2
Basically, I can see the archive being downloaded in the folder but then i see the error in the output and the archive is gone.
When restoring cache from a Github runner, the tar command looks exactly the same but the cache is restored.
Cache Size: ~613 MB (643139890 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/id/cache.tzst -P -C /home/runner/work/repo/repo
Cache restored successfully
In the self hosted runner, i do have tar and zstd installed as you can see from debug outputs as well. This of course results in a cache miss.
Any idea on what this particular issue is all about? Am I missing something and this Is just a configuration error?
Activity
sammcj commentedon Jun 2, 2022
We are having exactly the same problem.
sammcj commentedon Jun 22, 2022
This is still causing us issues.
sammcj commentedon Jun 22, 2022
We have logged an Enterprise support ticket for this, reference 1677362
lvpx commentedon Jul 11, 2022
Hi @sammcj , we investigated the above issue and noticed that it occurs for tar version <
1.30. From our testing ofAmazon linux 2instances, they come with tar version1.26and we were able to recreate the issue. If you could please test after upgrading the tar version at your end and see if it resolves the issue?sammcj commentedon Jul 12, 2022
Hi @pdotl, Amazon Linux 2 is the standard AWS operating system managed by AWS - the latest tar that is available is 1.26.
Given that Amazon Linux 2 is one of the most widely used distros and the main supported distro on AWS I think the Action should detect the OS or at least the tar version and pass the correct compression flags.
lvpx commentedon Jul 14, 2022
Hi @sammcj, we are working on getting this fixed. Meanwhile, here are a few workarounds that should get your workflows running:
sammcj commentedon Jul 19, 2022
@pdotl I spoke with the platform owners at the company I'm doing work with and they're not keen to switch from Amazon Linux 2 to Amazon Linux 2022 (very confusing versioning / naming from AWS here!) as it's in beta and not yet GA with Amazon - https://aws.amazon.com/linux/amazon-linux-2022/faqs/
sammcj commentedon Aug 3, 2022
Any update on this bug?
sammcj commentedon Aug 4, 2022
Hello,
I'm not sure why this ticket was closed again @pdotl - the issue has not been resolved?
Using the latest available version of Actions/Cache as of two hours ago:
lvpx commentedon Aug 5, 2022
Hi @sammcj
Apologies, the ticket was autoclosed probably because of the commit description citing the issues. The changes are about to be merged and will be available in the latest version of actions/cache today.
lvpx commentedon Aug 5, 2022
@sammcj please run your workflows with the latest available version of cache using
actions/cache@v3. The issue should now be resolved.sammcj commentedon Aug 7, 2022
@pdotl just did a test build - no more errors! Thank you 😄
sammcj commentedon Aug 10, 2022
FYI - after fixing this our Java builds have gone from 20-25mins right down to 5-7mins! 🎉