Closed bygui86 closed 3 years ago
Downloaded locally file
looks good:
[aarhurt@mbp ~/Downloads]$ file consul-backinator-1.6.6-amd64-*
consul-backinator-1.6.6-amd64-linux.tar.gz: gzip compressed data, last modified: Wed Dec 9 01:48:15 2020, from Unix, original size modulo 2^32 32270336
consul-backinator-1.6.6-amd64-linux.zip: Zip archive data, at least v1.0 to extract
My SHA256 sums also match, can you check yours?
[aarhurt@mbp ~/Downloads]$ shasum -a256 consul-backinator-1.6.6-amd64-linux.zip
9bf044a13aa7be2c5c25712535dcecbfde8f1f3e347f6e6a15cd42834a41560f consul-backinator-1.6.6-amd64-linux.zip
[aarhurt@mbp ~/Downloads]$ cat consul-backinator-1.6.6-SHA256SUMS|grep 9bf044a13aa7be2c5c25712535dcecbfde8f1f3e347f6e6a15cd42834a41560f
9bf044a13aa7be2c5c25712535dcecbfde8f1f3e347f6e6a15cd42834a41560f consul-backinator-1.6.6-amd64-linux.zip
[aarhurt@mbp ~/Downloads]$ shasum -a256 consul-backinator-1.6.6-amd64-linux.tar.gz
d9f2517c678904b75be6b0aff86cfd06375970380d6ae75353df7dafc38f191f consul-backinator-1.6.6-amd64-linux.tar.gz
[aarhurt@mbp ~/Downloads]$ cat consul-backinator-1.6.6-SHA256SUMS|grep d9f2517c678904b75be6b0aff86cfd06375970380d6ae75353df7dafc38f191f
d9f2517c678904b75be6b0aff86cfd06375970380d6ae75353df7dafc38f191f consul-backinator-1.6.6-amd64-linux.tar.gz
The files also extract fine locally. What utillity are you using inside your image?
[aarhurt@mbp ~/Downloads]$ tar tzvf consul-backinator-1.6.6-amd64-linux.tar.gz
drwxr-xr-x 0 njohnson staff 0 Dec 8 19:48 ./consul-backinator-1.6.6-amd64-linux/
-rwxr-xr-x 0 njohnson staff 32268288 Dec 8 19:48 ./consul-backinator-1.6.6-amd64-linux/consul-backinator-1.6.6
[aarhurt@mbp ~/Downloads]$ unzip -l consul-backinator-1.6.6-amd64-linux.zip
Archive: consul-backinator-1.6.6-amd64-linux.zip
Length Date Time Name
--------- ---------- ----- ----
0 12-08-2020 19:48 consul-backinator-1.6.6-amd64-linux/
32268288 12-08-2020 19:48 consul-backinator-1.6.6-amd64-linux/consul-backinator-1.6.6
--------- -------
32268288 2 files
Here the command to download (both locally and inside Dockerfile):
curl -O https://github.com/myENA/consul-backinator/releases/download/v1.6.6/consul-backinator-1.6.6-amd64-linux.tar.gz
Here the command to extract the archive (both locally and inside Dockerfile):
tar tzvf consul-backinator-1.6.6-amd64-linux.tar.gz
Here the output from tar tzvf consul-backinator-1.6.6-amd64-linux.tar.gz
:
tar: Error opening archive: Unrecognized archive format
Here the output from file consul-*
:
consul-backinator-1.6.6-SHA256SUMS: HTML document text, ASCII text, with very long lines, with no line terminators
consul-backinator-1.6.6-amd64-linux.tar.gz: HTML document text, ASCII text, with very long lines, with no line terminators
Here the output from shasum -a256 consul-backinator-1.6.6-amd64-linux.tar.gz
:
5e2b345cefb4deec12dca962e2b69d3c52c5fa45ea05f70beedbb442ee090928 consul-backinator-1.6.6-amd64-linux.tar.gz
No output from cat consul-backinator-1.6.6-SHA256SUMS | grep 5e2b345cefb4deec12dca962e2b69d3c52c5fa45ea05f70beedbb442ee090928
As you can see file type is not gzip
as expected but HTML
and sha256 does not match.
I tried to download another tar.gz package
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-334.0.0-linux-x86_64.tar.gz
and everything works perfectly.
I always use curl -O
, I don't understand why in this case it does not work...
FYI: running on MacOS Big Sur 11.2.3
Ahh, I see. It's how GitHub does downloads. They do a redirect. Sorry I didn't catch that before.
[aarhurt@mbp ~/Downloads]$ curl -O https://github.com/myENA/consul-backinator/releases/download/v1.6.6/consul-backinator-1.6.6-amd64-linux.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 648 100 648 0 0 1732 0 --:--:-- --:--:-- --:--:-- 1732
[aarhurt@mbp ~/Downloads]$ file consul-backinator-1.6.6-amd64-linux.tar.gz
consul-backinator-1.6.6-amd64-linux.tar.gz: HTML document text, ASCII text, with very long lines, with no line terminators
[aarhurt@mbp ~/Downloads]$ cat consul-backinator-1.6.6-amd64-linux.tar.gz
<html><body>You are being <a href="https://github-releases.githubusercontent.com/43525589/af0df980-398e-11eb-9736-9930e8f0b7d9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210401%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210401T160333Z&X-Amz-Expires=300&X-Amz-Signature=3ab36bbc0c7096d6cd55a382ba5437b9f88b1a2a7f55b92febf0283d74a13bf7&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=43525589&response-content-disposition=attachment%3B%20filename%3Dconsul-backinator-1.6.6-amd64-linux.tar.gz&response-content-type=application%2Foctet-stream">redirected</a>.</body></html>
Use the -L
flag to curl so it will follow redirects:
[aarhurt@mbp ~/Downloads]$ rm consul-backinator-1.6.6-amd64-linux.tar.gz
[aarhurt@mbp ~/Downloads]$ curl -L -O https://github.com/myENA/consul-backinator/releases/download/v1.6.6/consul-backinator-1.6.6-amd64-linux.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 648 100 648 0 0 4050 0 --:--:-- --:--:-- --:--:-- 4050
100 7823k 100 7823k 0 0 12.1M 0 --:--:-- --:--:-- --:--:-- 12.1M
[aarhurt@mbp ~/Downloads]$ file consul-backinator-1.6.6-amd64-linux.tar.gz
consul-backinator-1.6.6-amd64-linux.tar.gz: gzip compressed data, last modified: Wed Dec 9 01:48:15 2020, from Unix, original size modulo 2^32 32270336
@bygui86 Going to close this issue. Let me know if the above solution doesn't resolve the issue.
@leprechau thanks a lot for that! Yeah the issue is solved! I was not considering the redirect!! So stupid :(
Hi guys
I tried to add consul-backinator to a custom Docker image I'm building.
Here the Dockerfile
I have no idea why, but running the command
tar -zxf consul-backinator-1.6.6-amd64-linux.tar.gz
gives me this error:I tried with zip archive
but more or less the message is the same (command
unzip consul-backinator-1.6.6-amd64-linux.zip
):I tried to download and extract packages locally (macos) and the errors are the same!
It seems that archives are corrupted. Any idea why? How can I solve this?