imjasonh / setup-crane

Apache License 2.0
21 stars 10 forks source link

Unexpected error: `gzip: stdin: unexpected end of file` #7

Closed lucetre closed 1 year ago

lucetre commented 1 year ago

We have encountered with an unexpected error as below (resolved after rerunning the failed job). We are now using imjasonh/setup-crane@v0.1. Do you guys have any idea about why it has been happened or how to prevent this misbehavior? Thanks in advance.

+ case latest-release in
++ curl -s -u username:*** https://api.github.com/repos/google/go-containerregistry/releases/latest
++ jq -r .tag_name
+ tag=v0.13.0
+ os=Linux
+ [[ Linux == \m\a\c\O\S ]]
+ [[ ! -z v0.13.0 ]]
+ echo 'Installing crane @ v0.13.0 for Linux'
+ curl -fsL https://github.com/google/go-containerregistry/releases/download/v0.13.0/go-containerregistry_Linux_x86_64.tar.gz
Installing crane @ v0.13.0 for Linux
+ sudo tar xzf - -C /usr/local/bin crane

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
image
imjasonh commented 1 year ago

I've seen this as well recently. I believe this is due to an error when GitHub serves the content. If the stream is broken during download, the file will be incomplete, and gzipping it fails due to reaching the end of the file unexpectedly.

It's possible the installer action could detect this better and retry the download, but it's pretty tough to test since GitHub usually serves the content without any issue.

If you're seeing this repeatedly and ideally reproducibly, that would be helpful to know.

lucetre commented 1 year ago

Then rerunning would be the solution for now. Thank you so much for your answer.