cache: Cache fails with zstd error - zstd -d: Cannot exec: No such file or directory

Despite zstd being installed, the cache action fails as it appears to be looking for zstd in the wrong location.

  • Operation System: Amazon Linux 2
  • Action version: v3
  • Runner version: Latest stable

Job:

- uses: actions/checkout@v3
- name: Cache Maven repository
  uses: actions/cache@v3
  with:
    path: ~/.m2/repository
    key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
    restore-keys: |
      ${{ runner.os }}-maven-
Run actions/cache@v3
Received 0 of 4[7](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:8)5287217 (0.0%), 0.0 MBs/sec
Received 0 of 475287217 (0.0%), 0.0 MBs/sec
Received 4194304 of 4752[8](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:9)7217 (0.[9](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:10)%), 1.3 MBs/sec
Received 46137344 of 475287217 (9.7%), 11.0 MBs/sec
Received 83886080 of 475287217 (17.6%), 16.0 MBs/sec
Received [10](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:11)4857600 of 475287217 (22.1%), 16.7 MBs/sec
Received [13](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:14)4217728 of 475287217 (28.2%), 18.3 MBs/sec
Received 167772160 of 475287217 (35.3%), 20.0 MBs/sec
Received 197132288 of 475287217 (41.5%), 20.9 MBs/sec
Received 234881024 of 475287217 (49.4%), 22.4 MBs/sec
Received 268435456 of 475287217 (56.5%), 23.3 MBs/sec
Received 297795584 of 475287217 (62.7%), 23.6 MBs/sec
Received 339738624 of 475287217 (71.5%), 24.9 MBs/sec
Received 369098752 of 475287217 (77.7%), 25.1 MBs/sec
Received 406847488 of 475287217 (85.6%), 25.8 MBs/sec
Received 4362076[16](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:17) of 4752872[17](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:18) (91.8%), 26.0 MBs/sec
Received 471092913 of 475287217 (99.1%), 26.4 MBs/sec
Received 475287217 of 475287217 (100.0%), 26.2 MBs/sec
Cache Size: ~453 MB (475287217 B)
/bin/tar --use-compress-program zstd -d -xf /home/ec2-user/actions-runner/_work/_temp/469[19](https://github.com/OrgName/repo-name/runs/6702665797?check_suite_focus=true#step:3:20)ba1-0057-4976-990d-1f9cd28b3900/cache.tzst -P -C /home/ec2-user/actions-runner/_work/repo-name/repo-name
tar (child): zstd -d: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
/bin/tar: Child returned status 2
/bin/tar: Error is not recoverable: exiting now
Warning: Tar failed with error: The process '/bin/tar' failed with exit code 2

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 47 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Switching to v3 from v2 worked for me.

Experiencing what I believe is a related error with cache@v2.

Can't use 'tar -xzf' extract archive file: /home/runner/work/_actions/_temp_87e210c3-fb31-497b-9ab0-da952e03417f/5c14691f-39b6-4ada-a092-3021917c4b2d.tar.gz. return code: 2.

Summarizing the issue: We had an issue with codeload, which serves these archives, which resulting to 0mb. After the issue was resolved, some of host end up having 0mb archive and we deleted those cached files from hosts. but looks like some process have still kept this file in open state. So we redeployed error causing host to make sure no host have 0mb archive. So now we should not have 0mb archive from https://api.github.com/repos/actions/cache/tarball/937d24475381cd9c75ae6db12cb4e79714b926ed (v2) https://api.github.com/repos/actions/cache/tarball/30f413bfed0a2bc738fdfd409e5a9e96b24545fd (v3) Both of the above should result non zero mb archives.

It should be fixed, we have removed cached codeload file.

Seems to be due to https://api.github.com/repos/actions/cache/tarball/937d24475381cd9c75ae6db12cb4e79714b926ed being zero bytes

@tguilpain now it should result to 1.1Mb file. Can you please check and see if this is working fine now for you ?

Closing as resolved. Thank you @tiwarishub for taking this up. Summary-

Summarizing the issue: We had an issue with codeload, which serves these archives, which resulting to 0mb. After the issue was resolved, some of host end up having 0mb archive and we deleted those cached files from hosts. but looks like some process have still kept this file in open state. So we redeployed error causing host to make sure no host have 0mb archive. So now we should not have 0mb archive from https://api.github.com/repos/actions/cache/tarball/937d24475381cd9c75ae6db12cb4e79714b926ed (v2) https://api.github.com/repos/actions/cache/tarball/30f413bfed0a2bc738fdfd409e5a9e96b24545fd (v3) Both of the above should result non zero mb archives.

I’m still on cache@v2. Restarting the failed jobs multiple times worked for me as well.

Restarting the failed jobs multiple times seems to resolve the issue for me sometimes. I’m still on v2.

cc @tiwarishub

curl -sIL https://api.github.com/repos/actions/setup-python/tarball/7f80679172b057fc5e90d70d197929d454754a5a | grep content-length                                                             
content-length: 0

I am still getting the same error from other repos

We are also still on v2 and restarting the jobs seems to resolve the issue.

@tiwarishub Upgrade to v3 is still not doing much for me: image //EDIT What is interesting it works on 1 of 3 jobs running with matrix image Two remaining matrix jobs still fail with: image So maybe there is some local runner cache for cache action?

Switching to v3 from v2 worked for me.

I am already using v3 and getting the same error then what can be done?

@DrashtyDadhaniya , I think today’s failures may be caused by the GH outage: https://www.githubstatus.com/. See the similar problem (but with the checkout action) tracked here: https://github.com/actions/checkout/issues/1450.

Switching to v3 from v2 worked for me.

I am already using v3 and getting the same error then what can be done?

Okay, i found we already have one open issue related to this https://github.com/actions/cache/issues/809. Closing this and follow up there

There looks to still be an issue with actions/cache@v3 on the cleanup stage @vsvipul :

Post job cleanup.
/bin/tar --posix --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/ec[2](https://github.com/OrgName/repo-name/runs/6750348758?check_suite_focus=true#step:10:2)-user/actions-runner/_work/repo-name/repo-name --files-from manifest.txt
tar (child): zstd -T0: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
Warning: Tar failed with error: The process '/bin/tar' failed with exit code null

true, seem to be better now. thx !!

I was using v3 and it failed again. But after enabling debug and rerunning seems like it is now working (at least it does not fail in same place as before).

It should be fixed, we have removed cached codeload file.

Seems to be due to https://api.github.com/repos/actions/cache/tarball/937d24475381cd9c75ae6db12cb4e79714b926ed being zero bytes

@tguilpain now it should result to 1.1Mb file. Can you please check and see if this is working fine now for you ?

Still Getting:

Download action repository 'actions/cache@v2' (SHA:937d24475381cd9c75ae6db12cb4e79714b926ed)
Error: Can't use 'tar -xzf' extract archive file: /home/runner/work/_actions/_temp_0465fe7c-7a64-4409-827a-a2dfce55d668/e800866b-99b7-4df9-bd5a-b8dfb911fd5d.tar.gz. return code: 2.

The job on v2 is still trying to pull https://api.github.com/repos/actions/cache/tarball/937d24475381cd9c75ae6db12cb4e79714b926ed and it still results in a zero bytes archive for me

Error in description is while downloading the cache but in subsequent comments it for downloading the tar ball of actions/cache (which is different and seems to be happening for most). We were seeing issues with codeload which seems to be fixed now. We will update here once get more details

I was running actions/cache@v2 and got the Error: Can't use 'tar -xzf' extract archive file: /home/runner/work/_actions/_temp_<random id>.tar.gz. return code: 2. error. I then updated all my workflows to use actions/cache@v3 and it seems to have fixed the problem.