cabal: Codec.Compression.Zlib: premature end of compressed stream #2001

Open
Zane-XY opened this Issue Jul 19, 2014 · 4 comments

Comments

Projects
None yet
8 participants
@Zane-XY

Zane-XY commented Jul 19, 2014

I am using ghc 7.8.3 with:

cabal --version
cabal-install version 1.20.0.3
using version 1.20.0.1 of the Cabal library

When I am trying to install scion-browser inside a fresh sandbox, I got the following error:

cabal install scion-browser
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/username/haskell/scion-browser/.cabal-sandbox
Configuring haskell-src-exts-1.14.0.1...
Configuring persistent-template-1.3.1.4...
cabal: Codec.Compression.Zlib: premature end of compressed stream

What does the error mean? How to fix it?

@carlohamalainen

This comment has been minimized.

Show comment
Hide comment
@carlohamalainen

carlohamalainen Dec 16, 2014

I have the same problem with GHC 7.6.3 on a Debian/Jessie system. I've
tried the latest cabal-install/Cabal from github:

root@befd8dcbcfb7:~# cabal --version
cabal-install version 1.21.1.0
using version 1.21.1.0 of the Cabal library

The bug is reproducible 100% of the time when I'm behind my
university's transparent proxy:

root@befd8dcbcfb7:~# rm -fr .cabal/packages
root@befd8dcbcfb7:~# cabal update -v3
Downloading the latest package list from hackage.haskell.org
Sending:
GET /packages/archive/00-index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.21.1.0 (linux; x86_64)

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Content-Type: text/plain; charset=UTF-8
Location: /packages/index.tar.gz
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:28:57 GMT
X-Served-By: cache-syd1620-SYD
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1418689737.086025,VS0,VE202
X-Cache: MISS from proxy6.uq.edu.au
X-Cache-Lookup: MISS from proxy6.uq.edu.au:80
Transfer-Encoding: chunked
Via: 1.1 varnish, 1.1 proxy6.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close
Content-Length: 0

301 - redirect
Redirecting to http://hackage.haskell.org/packages/index.tar.gz ...
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.21.1.0 (linux; x86_64)

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 200 OK
Server: nginx/1.6.2
Content-Type: application/x-gzip
Cache-Control: public, no-transform, max-age=300
Content-MD5: 8138fe87217589727ea9f9f2c41fff87
ETag: "8138fe87217589727ea9f9f2c41fff87"
Last-Modified: Mon, 15 Dec 2014 23:59:34 GMT
Content-Length: 8349866
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:28:57 GMT
Age: 35
X-Served-By: cache-syd1620-SYD
X-Cache: HIT
X-Cache-Hits: 1
X-Timer: S1418689737.317896,VS0,VE29
X-Cache: MISS from proxy6.uq.edu.au
X-Cache-Lookup: MISS from proxy6.uq.edu.au:80
Via: 1.1 varnish, 1.1 proxy6.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close

Downloaded to /root/.cabal/packages/hackage.haskell.org/00-index.tar.gz
cabal: Codec.Compression.Zlib: premature end of compressed stream

If I downgrade to cabal-install to 1.20.0.2 and Cabal to 1.20.0.1
then cabal update runs fine:

root@78cf18f6605a:~# cabal --version
cabal-install version 1.20.0.2
using version 1.20.0.1 of the Cabal library

root@78cf18f6605a:~# cabal update -v3
Downloading the latest package list from hackage.haskell.org
Sending:
GET /packages/archive/00-index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.20.0.2 (linux; x86_64)
If-None-Match: "79ab9573663df4b32d3e8969002a59ce"

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Content-Type: text/plain; charset=UTF-8
Location: /packages/index.tar.gz
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:23:34 GMT
Age: 0
X-Served-By: cache-syd1620-SYD
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1418689414.053972,VS0,VE201
X-Cache: MISS from proxy4.uq.edu.au
X-Cache-Lookup: MISS from proxy4.uq.edu.au:80
Transfer-Encoding: chunked
Via: 1.1 varnish, 1.1 proxy4.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close
Content-Length: 0

301 - redirect
Redirecting to http://hackage.haskell.org/packages/index.tar.gz ...
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.20.0.2 (linux; x86_64)
If-None-Match: "79ab9573663df4b32d3e8969002a59ce"

Recovering connection to hackage.haskell.org
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.20.0.2 (linux; x86_64)
If-None-Match: "79ab9573663df4b32d3e8969002a59ce"

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 200 OK
Server: nginx/1.6.2
Content-Type: application/x-gzip
Cache-Control: public, no-transform, max-age=300
Content-MD5: 8138fe87217589727ea9f9f2c41fff87
ETag: "8138fe87217589727ea9f9f2c41fff87"
Last-Modified: Mon, 15 Dec 2014 23:59:34 GMT
Content-Length: 8349866
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:23:34 GMT
Age: 166
X-Served-By: cache-syd1620-SYD
X-Cache: HIT
X-Cache-Hits: 2
X-Timer: S1418689414.281277,VS0,VE0
X-Cache: MISS from proxy4.uq.edu.au
X-Cache-Lookup: MISS from proxy4.uq.edu.au:80
Via: 1.1 varnish, 1.1 proxy4.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close

Downloaded to /root/.cabal/packages/hackage.haskell.org/00-index.tar.gz
Updating the index cache file...

I'd like to help with debugging this problem but I'm not sure where to start.

I have the same problem with GHC 7.6.3 on a Debian/Jessie system. I've
tried the latest cabal-install/Cabal from github:

root@befd8dcbcfb7:~# cabal --version
cabal-install version 1.21.1.0
using version 1.21.1.0 of the Cabal library

The bug is reproducible 100% of the time when I'm behind my
university's transparent proxy:

root@befd8dcbcfb7:~# rm -fr .cabal/packages
root@befd8dcbcfb7:~# cabal update -v3
Downloading the latest package list from hackage.haskell.org
Sending:
GET /packages/archive/00-index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.21.1.0 (linux; x86_64)

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Content-Type: text/plain; charset=UTF-8
Location: /packages/index.tar.gz
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:28:57 GMT
X-Served-By: cache-syd1620-SYD
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1418689737.086025,VS0,VE202
X-Cache: MISS from proxy6.uq.edu.au
X-Cache-Lookup: MISS from proxy6.uq.edu.au:80
Transfer-Encoding: chunked
Via: 1.1 varnish, 1.1 proxy6.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close
Content-Length: 0

301 - redirect
Redirecting to http://hackage.haskell.org/packages/index.tar.gz ...
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.21.1.0 (linux; x86_64)

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 200 OK
Server: nginx/1.6.2
Content-Type: application/x-gzip
Cache-Control: public, no-transform, max-age=300
Content-MD5: 8138fe87217589727ea9f9f2c41fff87
ETag: "8138fe87217589727ea9f9f2c41fff87"
Last-Modified: Mon, 15 Dec 2014 23:59:34 GMT
Content-Length: 8349866
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:28:57 GMT
Age: 35
X-Served-By: cache-syd1620-SYD
X-Cache: HIT
X-Cache-Hits: 1
X-Timer: S1418689737.317896,VS0,VE29
X-Cache: MISS from proxy6.uq.edu.au
X-Cache-Lookup: MISS from proxy6.uq.edu.au:80
Via: 1.1 varnish, 1.1 proxy6.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close

Downloaded to /root/.cabal/packages/hackage.haskell.org/00-index.tar.gz
cabal: Codec.Compression.Zlib: premature end of compressed stream

If I downgrade to cabal-install to 1.20.0.2 and Cabal to 1.20.0.1
then cabal update runs fine:

root@78cf18f6605a:~# cabal --version
cabal-install version 1.20.0.2
using version 1.20.0.1 of the Cabal library

root@78cf18f6605a:~# cabal update -v3
Downloading the latest package list from hackage.haskell.org
Sending:
GET /packages/archive/00-index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.20.0.2 (linux; x86_64)
If-None-Match: "79ab9573663df4b32d3e8969002a59ce"

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Content-Type: text/plain; charset=UTF-8
Location: /packages/index.tar.gz
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:23:34 GMT
Age: 0
X-Served-By: cache-syd1620-SYD
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1418689414.053972,VS0,VE201
X-Cache: MISS from proxy4.uq.edu.au
X-Cache-Lookup: MISS from proxy4.uq.edu.au:80
Transfer-Encoding: chunked
Via: 1.1 varnish, 1.1 proxy4.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close
Content-Length: 0

301 - redirect
Redirecting to http://hackage.haskell.org/packages/index.tar.gz ...
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.20.0.2 (linux; x86_64)
If-None-Match: "79ab9573663df4b32d3e8969002a59ce"

Recovering connection to hackage.haskell.org
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.20.0.2 (linux; x86_64)
If-None-Match: "79ab9573663df4b32d3e8969002a59ce"

Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 200 OK
Server: nginx/1.6.2
Content-Type: application/x-gzip
Cache-Control: public, no-transform, max-age=300
Content-MD5: 8138fe87217589727ea9f9f2c41fff87
ETag: "8138fe87217589727ea9f9f2c41fff87"
Last-Modified: Mon, 15 Dec 2014 23:59:34 GMT
Content-Length: 8349866
Accept-Ranges: bytes
Date: Tue, 16 Dec 2014 00:23:34 GMT
Age: 166
X-Served-By: cache-syd1620-SYD
X-Cache: HIT
X-Cache-Hits: 2
X-Timer: S1418689414.281277,VS0,VE0
X-Cache: MISS from proxy4.uq.edu.au
X-Cache-Lookup: MISS from proxy4.uq.edu.au:80
Via: 1.1 varnish, 1.1 proxy4.uq.edu.au:80 (squid/2.7.STABLE9)
Connection: close

Downloaded to /root/.cabal/packages/hackage.haskell.org/00-index.tar.gz
Updating the index cache file...

I'd like to help with debugging this problem but I'm not sure where to start.

@tobiasBora

This comment has been minimized.

Show comment
Hide comment
@tobiasBora

tobiasBora Oct 20, 2015

Hello,

I also have this very annoying problem, and I also run under a university proxy. I can help you to debug if needed !

Hello,

I also have this very annoying problem, and I also run under a university proxy. I can help you to debug if needed !

@23Skidoo 23Skidoo modified the milestones: cabal-install 1.24, cabal-install 1.26 Feb 21, 2016

@phadej

This comment has been minimized.

Show comment
Hide comment
@phadej

phadej Jul 12, 2016

Collaborator

I'm not sure, there might be different problems:

  • multiple users: //root/.cabal/packages/hackage.haskell.org/00-index.tar.gz path is suspicious
  • something weird happening with zlib, cabal-install-1.24 compiled with zlib-0.6.* should be quite robust, can you try it?
Collaborator

phadej commented Jul 12, 2016

I'm not sure, there might be different problems:

  • multiple users: //root/.cabal/packages/hackage.haskell.org/00-index.tar.gz path is suspicious
  • something weird happening with zlib, cabal-install-1.24 compiled with zlib-0.6.* should be quite robust, can you try it?
@ambuc

This comment has been minimized.

Show comment
Hide comment
@ambuc

ambuc Dec 16, 2016

I have the same issue:

$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library 

$ cabal install permutation
Resolving dependencies...
cabal: Codec.Compression.Zlib: premature end of compressed stream

Happy to help debug / provide more info. if needed.

ambuc commented Dec 16, 2016

I have the same issue:

$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library 

$ cabal install permutation
Resolving dependencies...
cabal: Codec.Compression.Zlib: premature end of compressed stream

Happy to help debug / provide more info. if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment