Closed casperbakker closed 7 years ago
This is an environment issue. Not packagist or composer related. Look through the existing (closed) issues on the composer repository for possible solutions (such as preferring ipv4 traffic over ipv6, or downgrading virtualbox to a specific version if you are using virtualbox, etc). It could also mean you have a bad firewall or proxy in your network.
I doubt that, because I read all those threads and tried every single thing. Plus I tried it in a lot of different environments, with different Vagrant/Virtualbox/Host OS/Guest OS/Connection/packages/etc.
But if no one having the same issues then I guess it is just bad luck.
Thanks for your comment though.
I had the same issue yesterday in our office with composer under macOS Sierra. Today it was fine. However another team member, which works remotely have now the same issue under Windows.
We are working on the very same repository.
There is reference in the error about troubleshooting: https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode It helped me with protocol priority (at least yesterday):
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
This is however very strange fix, since complete disabling of IPv6 did not helped. This is possibly not exactly composer problem, but do we have any option to protect an installation from such issues?
Especially when we have automated deploy on production?
@casperbakker , did you ever resolve your composer issue? I've been getting this for two days now and can't find the resolution. I've tried the ipv6 prededence trick, but it's not helping my Ubuntu 16.04 LTS VM hosted on macOS Sierra in VirtualBox. My internet is blazing fast even from the VM. If I manually try to grab one of the .json packgist files it blazes down - no clue why zlib_decode would have issues with the speed.
Downloading http://packagist.org/p/vich/uploader-bundle%24aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Downloading http://packagist.org/p/vich/uploader-bundle%24aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json
Downloading http://packagist.org/p/vich/uploader-bundle%24aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json
Downloading http://packagist.org/p/vich/uploader-bundle%24aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json
[ErrorException]
zlib_decode(): data error
wget http://packagist.org/p/vich/uploader-bundle%24aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json
--2016-11-10 15:39:51-- http://packagist.org/p/vich/uploader-bundle%24aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json
Resolving packagist.org (packagist.org)... 87.98.253.214, 2001:41d0:a:7b19::3
Connecting to packagist.org (packagist.org)|87.98.253.214|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58334 (57K) [application/json]
Saving to: ‘uploader-bundle$aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json’
uploader-bundle$aa6bf9b2e7aef 100%[================================================>] 56.97K 255KB/s in 0.2s
2016-11-10 15:39:52 (255 KB/s) - ‘uploader-bundle$aa6bf9b2e7aefd47402f1c378df625938c1347b14451df0ddf1afc59b3954927.json’ saved [58334/58334]
Continuing to dive on this issue, will return should I find a solution for my specific situation.
@casperbakker any chance you're using php 7
PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.8-0ubuntu0.16.04.3, Copyright (c) 1999-2016, by Zend Technologies
There are things from over a year ago that helped some people, but I've tried all the solutions in this long thread and I'm still no good: https://github.com/composer/composer/issues/4121
Env. Host macOS Sierra, VirtualBox with Ubuntu 16.04. Have tried disabling all ipv6, tried forcing to ipv4 packagist, have tried straight source packagist, have self-updated after clearing composer cache plenty of times. Tried going back and forth between wifi and wired networks.
I'm having this problem as well. I've tried everything on the very long thread mentioned above.
VirtualBox is known to cause issue. See composer/composer#5814
Thanks @alcohol. That fixed it.
I just kept trying, after a couple of hours it worked again. I indeed use php 7.
Great if it is fixed in VirtualBox. But I got the same thing on AWS.
It appear that VirtualBox 5.1.18 has that problem, but 5.1.16 is fine.
Virtualbox 5.0.30 r112061 worked well in my case...
@casperbakker Did you end up resolving your issue in AWS? Sorry for reviving a dead thread, but I'm experiencing the same issue in Ubuntu 16.04 on an EC2 t2.micro.
@casperbakker, @Arrisar, and I am having this isue to in my Ubuntu laptop (no virtualbox).
If you have a clue it would be nice! Thanks
I got it sometimes for periods of 24 hours, and later is works again. Without any change on my side. As mentioned before in this thread, I am pretty convinced it is a hosting/server issue on packagist's side. But I have no concrete evidence for that.
I did not have this issue seen again in recent months.
I am having the same issue. They appear to be working on the issue.
https://twitter.com/packagist?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor
"Our North American mirror for http://packagist.org is having some issues leading to Content-Length errors. We are aware and working on it"
I get this zlib_decode(): data error
a lot from my workplace, but not from home. Related to a "connection reset by peer". The downloader code (file_get_contents()
) is not checking if the file download was complete and then try to unzip (decode) a partially downloaded file, which generates this error.
A wget is sometimes able to download the file, here you can see it was able after a retry:
Sometimes it get stuck in a "Connection reset by peer" retry loop. But Composer's file_get_contents()
does not "continue" a partially downloaded file, so it keeps getting that error.
The strangest thing about this is: downloading the very same file via Chrome works every time. So it might be the way the file is being requested from the server, maybe the browser agent?
Over the weekend and also today, I keep getting
zlib_decode(): data error
errors when runningcomposer update
.I tried a lot of things, like disabling IPv6 and with different internet connections. And it fails on different packages, but always on the packagist.org host. All Github and other downloads succeed every time.
My internet connection is working fine, low pings and fast speeds (100Mb/s+) and tried different DNS servers and different providers, so this should not matter.
So it looks like trouble with the hosting of packagist.org
Anyone else has this same problem? And hopefully someone has a solution?