Step should not succeed when tar fails with error
See original GitHub issueUsing a simple step to restore the build x cache we encountered an error (below). I believe the issue is that the GitHub cache became corrupt. However actions/cache did not catch the error.
- name: Cache layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
So only a warning was printed instead of failing the step:
....
/*stdin*\ : Decoding error (36) : Restored data doesn't match checksum
/usr/bin/tar: Child returned status 1
/usr/bin/tar: Error is not recoverable: exiting now
Warning: Tar failed with error: The process '/usr/bin/tar' failed with exit code 2
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top Results From Across the Web
tar: Exiting with failure status due to previous errors - Super User
I do not see any error messages whilst the script is working, and like I said, the produced file can be uncompressed with...
Read more >Github Actions "Set up job" fails with tar error · Issue #815
Since earlier today, a Github Actions workflow which has been working reliably for many months has started failing with a tar error.
Read more >tar exits with "write error" even though there is no error at all
(5) tar correctly handles the write error upon exit. What was not really obvious is step (2). I checked the behavior of ksh/bash/zsh...
Read more >Error code 141 with tar - Stack Overflow
My guess here is that gzip is uncompressing the file successfully, but the uncompressed stream is not a valid tar archive. My advice...
Read more >"tar: .: Cannot utime: Operation not permitted" while ... - ERROR
To resolve this issue, move the tar file into a directory that you are the owner of. This will allow you to completely...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Btw, there are REST APIs available now to be able to delete a corrupted cache. This can help come out of a situation where a cache is corrupted the only alternative is to update the cache key forcibly.
That is already possible with
cache-hit
output. It is set if a cache has been restored with exact matching key. If it is not set, then it is a good idea to run the install/build steps.Agree. Any failure in unarchiving should be handled more cleanly.