Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-436: 19.3 Source file downloaded hasn't been gzipped (is a plain tar) #3468

Closed
OTP-Maintainer opened this issue Jun 20, 2017 · 5 comments
Labels
bug Issue is reported as a bug priority:medium

Comments

@OTP-Maintainer
Copy link

Original reporter: ombuds
Affected version: OTP-19.3
Component: Not Specified
Migrated from: https://bugs.erlang.org/browse/ERL-436


The downloaded otp_src_19.3.tar.gz hasn't been gzipped, consider:

cd ~/Downloads
$ ls -lh
total 211M
-rw-rw-r-- 1 s s 211M Jun 20 01:52 otp_src_19.3.tar.gz
$ file otp_src_19.3.tar.gz 
otp_src_19.3.tar.gz: POSIX tar archive (GNU)
$ tar xzf otp_src_19.3.tar.gz 

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
$ tar xf otp_src_19.3.tar.gz 
$ ls -lh
total 211M
drwxr-xr-x 12 s s 4.0K Mar 15 02:57 otp_src_19.3
-rw-rw-r--  1 s s 211M Jun 20 01:52 otp_src_19.3.tar.gz
$ 

@OTP-Maintainer
Copy link
Author

ombuds said:

The fix is trivial! (+ it's going to save everyone who downloads the Erlang source file a bunch of bandwidth!)

fix-1:
$ tar czf otp_src_19.3.tar.gz otp_src_19.3/
$ ls -lh
total 277M
drwxr-xr-x 12 s s 4.0K Mar 15 02:57 otp_src_19.3
-rw-rw-r--  1 s s 211M Jun 20 01:52 otp_src_19.3.tar
-rw-rw-r--  1 s s  66M Jun 20 02:08 otp_src_19.3.tar.gz

@OTP-Maintainer
Copy link
Author

ombuds said:

Trivial fix, will save those who download the Sources a bunch of bandwidth:

$ tar czf otp_src_19.3.tar.gz otp_src_19.3/
$ ls -lh
total 277M
drwxr-xr-x 12 s s 4.0K Mar 15 02:57 otp_src_19.3
-rw-rw-r--  1 s s 211M Jun 20 01:52 otp_src_19.3.tar
-rw-rw-r--  1 s s  66M Jun 20 02:08 otp_src_19.3.tar.gz

@OTP-Maintainer
Copy link
Author

ombuds said:

The fix is trivial, and will save those who download the Sources {time, bandwidth}

$ tar czf otp_src_19.3.tar.gz otp_src_19.3/
$ ls -lh
total 277M
drwxr-xr-x 12 s s 4.0K Mar 15 02:57 otp_src_19.3
-rw-rw-r--  1 s s 211M Jun 20 01:52 otp_src_19.3.tar
-rw-rw-r--  1 s s  66M Jun 20 02:08 otp_src_19.3.tar.gz

@OTP-Maintainer
Copy link
Author

ombuds said:

This seems like a simple procedure:

1. simply un-tar the (supposedly g'zipped) otp_src_19.3.tar.gz
2. tar it up again, but specify g'zipping, as in 'tar czf' of the un-tarred directory.

Cheers,
Ombuds

@OTP-Maintainer
Copy link
Author

srenatus said:

I'm just a bystander here, but this seems to come up every few weeks -- this has to do with the response header's of erlang.org's web server, I think:

Compare erlang.org

{code}
$ curl -v -XHEAD http://erlang.org/download/otp_src_19.3.tar.gz
Warning: Setting custom HTTP method to HEAD with -X/--request may not work the
Warning: way you want. Consider using -I/--head instead.
*   Trying 192.121.151.106...
* TCP_NODELAY set
* Connected to erlang.org (192.121.151.106) port 80 (#0)
> HEAD /download/otp_src_19.3.tar.gz HTTP/1.1
> Host: erlang.org
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 20 Jun 2017 09:25:27 GMT
< Server: Apache/1.3.42 (Unix)
< Last-Modified: Wed, 15 Mar 2017 10:14:05 GMT
< ETag: "2224dd-4156497-58c913ed"
< Accept-Ranges: bytes
< Content-Length: 68510871
< Content-Type: application/x-tar
< Content-Encoding: x-gzip
<
{code}

to github, for example:

{code}
$ curl -vL -XHEAD https://codeload.github.com/erlang/otp/tar.gz/OTP-19.3.4
Warning: Setting custom HTTP method to HEAD with -X/--request may not work the
Warning: way you want. Consider using -I/--head instead.
*   Trying 192.30.253.120...
* TCP_NODELAY set
* Connected to codeload.github.com (192.30.253.120) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.github.com
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> HEAD /erlang/otp/tar.gz/OTP-19.3.4 HTTP/1.1
> Host: codeload.github.com
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Access-Control-Allow-Origin: https://render.githubusercontent.com
< Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'
< Strict-Transport-Security: max-age=31536000
< Vary: Authorization,Accept-Encoding
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< ETag: "f954cdea9b67369185094a3aea7cb611dd680b3c"
< Content-Type: application/x-gzip
< Content-Disposition: attachment; filename=otp-OTP-19.3.4.tar.gz
< X-Geo-Block-List:
< Date: Tue, 20 Jun 2017 09:27:02 GMT
< X-GitHub-Request-Id: 7171:503B:13F5F9:18CCA7:5948EA65
<
{code}

Erlang.org sends
{code}
< Content-Type: application/x-tar
< Content-Encoding: x-gzip
{code}

instead of 
{code}
< Content-Type: application/x-gzip
{code}

so any well-behaved HTTP client will gunzip and save the tar.

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug priority:medium labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium
Projects
None yet
Development

No branches or pull requests

1 participant