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

zlib_decode(): data error #5814

Closed
radutopala opened this issue Oct 25, 2016 · 65 comments

Comments

Projects
None yet
@radutopala
Copy link

commented Oct 25, 2016

My composer.json:

{
    "name": "test/test",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-4": {
            "": "src/"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "require": {
        "php": ">=7.0.11",
        "symfony/symfony": "3.1.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "doctrine/doctrine-migrations-bundle": "^1.1",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "symfony/assetic-bundle": "^2.8",
        "symfony/polyfill-apcu": "^1.0",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "snc/redis-bundle": "2.x-dev",
        "predis/predis": "^1.0",
        "lexik/jwt-authentication-bundle": "^1.5",
        "tss/automailer-bundle": "dev-master",
        "knplabs/knp-paginator-bundle": "^2.5",
        "fabpot/goutte": "^3.1",
        "whiteoctober/breadcrumbs-bundle": "^1.2",
        "spraed/pdf-generator-bundle": "^1.3",
        "vich/uploader-bundle": "1.2.0",
        "friendsofsymfony/jsrouting-bundle": "^1.6",
        "gregwar/captcha-bundle": "^2.0",
        "liip/imagine-bundle": "^1.6",
        "knplabs/knp-menu-bundle": "^2.0",
        "fabpot/php-cs-fixer": "^1.12",
        "symfony/serializer": "^3.1",
        "jms/serializer": "^1.3",
        "jms/serializer-bundle": "^1.1"

    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        }
    }
}

Output of composer diagnose:

Checking composer.json: WARNING
Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance
require.snc/redis-bundle : exact version constraints (2.x-dev) should be avoided if the package follows semantic versioning
require.tss/automailer-bundle : unbound version constraints (dev-master) should be avoided
require.vich/uploader-bundle : exact version constraints (1.2.0) should be avoided if the package follows semantic versioning
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK

When I run this command:

composer update --lock -vvv

I get the following output:

Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Running 1.2.1 (2016-09-12 11:27:19) with PHP 7.0.11-1+deb.sury.org~trusty+1 on Linux / 3.13.0-86-generic
Reading ./composer.lock
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-2014.json from cache
Downloading http://packagist.org/p/provider-2015%245cb89636f37ca04dbb7ceb6ba2f12ccbc6cd3a53b2ae3528c090a56f90975e18.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-2015.json into cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-2016-01.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-2016-04.json from cache
Downloading http://packagist.org/p/provider-2016-07%247062176fff1b75c50a0a1383e29cc73864f4c0ce30d243c1234e0833be1193c0.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-2016-07.json into cache
Downloading http://packagist.org/p/provider-2016-10%244d79c57bd512ea7c9843446e53ae95329eef94e3be3511f5f701a5f400739bd0.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-2016-10.json into cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-archived.json from cache
Downloading http://packagist.org/p/provider-latest%24dbfb3faaaffdfaec3494564d129e9a9310fc4a753efad4fcc8b4f91cf787398a.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/p-provider-latest.json into cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$lexer.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$annotations.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-util.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-paragonie$random-compat.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-php70.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-php56.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-mbstring.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$intl.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-intl-icu.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$icu.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-php54.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$inflector.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$collections.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$cache.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$common.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-jdorn$sql-formatter.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$doctrine-bridge.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$doctrine-cache-bundle.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$dbal.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$console.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$framework-bundle.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-doctrine$doctrine-bundle.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$security-acl.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$debug.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$config.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$dependency-injection.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$event-dispatcher.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$filesystem.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$http-kernel.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$routing.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$stopwatch.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$templating.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$translation.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$http-foundation.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$finder.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$security-core.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$security-csrf.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$asset.json from cache
Reading /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$class-loader.json from cache
Downloading http://packagist.org/p/symfony/cache%24a1f76f69d06d444880b68ccf242fb1bd45fc3e1ab332313999d2669d3a5e2672.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/symfony/cache%24a1f76f69d06d444880b68ccf242fb1bd45fc3e1ab332313999d2669d3a5e2672.json
Downloading http://packagist.org/p/symfony/cache%24a1f76f69d06d444880b68ccf242fb1bd45fc3e1ab332313999d2669d3a5e2672.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$cache.json into cache
Downloading http://packagist.org/p/psr/log%244f0edf1b639fc9b0914c0c8d13bef27cdaa71100c3719780a0459b9dd799753d.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/provider-psr$log.json into cache
Downloading http://packagist.org/p/symfony/polyfill-php55%242c54472a8856ee39440a29ee7182c3205d88d60817040f9dea8604d9eb7f2a41.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-php55.json into cache
Downloading http://packagist.org/p/symfony/polyfill-apcu%24a910411a4953aeae3659a62e7334cc11b50e9066d4dc6a6b63ff4a665879ebb1.json
Writing /home/vagrant/.cache/composer/repo/https---packagist.org/provider-symfony$polyfill-apcu.json into cache
Downloading http://packagist.org/p/psr/cache%24ed2696a6c78734dcaf8b8eb5ba4b7ebc9d2822015a1211521e390c514093e303.json
Downloading http://packagist.org/p/psr/cache%24ed2696a6c78734dcaf8b8eb5ba4b7ebc9d2822015a1211521e390c514093e303.json
Downloading http://packagist.org/p/psr/cache%24ed2696a6c78734dcaf8b8eb5ba4b7ebc9d2822015a1211521e390c514093e303.json


  [ErrorException]
  zlib_decode(): data error


Exception trace:
 () at phar:///bin/composer/src/Composer/Util/RemoteFilesystem.php:388
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 zlib_decode() at phar:///bin/composer/src/Composer/Util/RemoteFilesystem.php:388
 Composer\Util\RemoteFilesystem->get() at phar:///bin/composer/src/Composer/Util/RemoteFilesystem.php:101
 Composer\Util\RemoteFilesystem->getContents() at phar:///bin/composer/src/Composer/Repository/ComposerRepository.php:646
 Composer\Repository\ComposerRepository->fetchFile() at phar:///bin/composer/src/Composer/Repository/ComposerRepository.php:332
 Composer\Repository\ComposerRepository->whatProvides() at phar:///bin/composer/src/Composer/DependencyResolver/Pool.php:204
 Composer\DependencyResolver\Pool->computeWhatProvides() at phar:///bin/composer/src/Composer/DependencyResolver/Pool.php:193
 Composer\DependencyResolver\Pool->whatProvides() at phar:///bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php:161
 Composer\DependencyResolver\RuleSetGenerator->whitelistFromPackage() at phar:///bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php:322
 Composer\DependencyResolver\RuleSetGenerator->getRulesFor() at phar:///bin/composer/src/Composer/DependencyResolver/Solver.php:214
 Composer\DependencyResolver\Solver->solve() at phar:///bin/composer/src/Composer/Installer.php:461
 Composer\Installer->doInstall() at phar:///bin/composer/src/Composer/Installer.php:216
 Composer\Installer->run() at phar:///bin/composer/src/Composer/Command/UpdateCommand.php:174
 Composer\Command\UpdateCommand->execute() at phar:///bin/composer/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at phar:///bin/composer/vendor/symfony/console/Application.php:847
 Symfony\Component\Console\Application->doRunCommand() at phar:///bin/composer/vendor/symfony/console/Application.php:192
 Symfony\Component\Console\Application->doRun() at phar:///bin/composer/src/Composer/Console/Application.php:231
 Composer\Console\Application->doRun() at phar:///bin/composer/vendor/symfony/console/Application.php:123
 Symfony\Component\Console\Application->run() at phar:///bin/composer/src/Composer/Console/Application.php:104
 Composer\Console\Application->run() at phar:///bin/composer/bin/composer:43
 require() at /bin/composer:24

And I expected this to happen:
Expected to update the composer.lock

@radutopala

This comment has been minimized.

Copy link
Author

commented Oct 25, 2016

@radutopala

This comment has been minimized.

Copy link
Author

commented Oct 25, 2016

Error is reproducible with all 1.2.*, not reproducible with 1.1.3.

@alcohol

This comment has been minimized.

Copy link
Member

commented Oct 26, 2016

Please search existing issues for possible solutions. This is not a Composer issue but an environment issue.

@alcohol alcohol closed this Oct 26, 2016

@radutopala

This comment has been minimized.

Copy link
Author

commented Oct 26, 2016

@alcohol not sure it's just an environment issue, because composer 1.1.3 works fine in the same environment, as I said above.

Have searched over the tickets, those are related:

@alcohol

This comment has been minimized.

Copy link
Member

commented Oct 26, 2016

Unless you can provide a way for me to reproduce it consistently, it is most definitely an environment issue.

@radutopala

This comment has been minimized.

Copy link
Author

commented Oct 26, 2016

@alcohol this fixed my issue: #4121 (comment). So basically forcing https did it..

The issue was happening in Vagrant boxes, with any kind of php or composer version. Using https://gist.github.com/radutopala/8761ac647ee165d373b0c6d727cd56ea, intermittently I got from 1 to 20 retries until successful decoding the gzip.

@alcohol

This comment has been minimized.

Copy link
Member

commented Oct 26, 2016

Let me guess, using a shared directory also with your host system?

@radutopala

This comment has been minimized.

Copy link
Author

commented Oct 26, 2016

@alcohol yes

@alcohol

This comment has been minimized.

Copy link
Member

commented Oct 26, 2016

What happens if you run it inside vagrant, without a shared directory? E.g. purely inside the vagrant box, storage inside the vagrant box too.

@radutopala

This comment has been minimized.

Copy link
Author

commented Oct 26, 2016

@alcohol apparently the same error:

vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Error in Decoding process! Re-fetching ...
Retry 1 | Error in Decoding process! Re-fetching ...
Retry 2 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Error in Decoding process! Re-fetching ...
Retry 1 | Error in Decoding process! Re-fetching ...
Retry 2 | Error in Decoding process! Re-fetching ...
Retry 3 | Error in Decoding process! Re-fetching ...
Retry 4 | Error in Decoding process! Re-fetching ...
Retry 5 | Error in Decoding process! Re-fetching ...
Retry 6 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Error in Decoding process! Re-fetching ...
Retry 1 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Error in Decoding process! Re-fetching ...
Retry 1 | Error in Decoding process! Re-fetching ...
Retry 2 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Error in Decoding process! Re-fetching ...
Retry 1 | Error in Decoding process! Re-fetching ...
Retry 2 | Error in Decoding process! Re-fetching ...
Retry 3 | Error in Decoding process! Re-fetching ...
Retry 4 | Error in Decoding process! Re-fetching ...
Retry 5 | Error in Decoding process! Re-fetching ...
Retry 6 | Error in Decoding process! Re-fetching ...
Retry 7 | Error in Decoding process! Re-fetching ...
Retry 8 | Error in Decoding process! Re-fetching ...
Retry 9 | Decoded successfully!

So it doesn't matter where the test is taken, either in shared folder or in an internal box folder.

For what is worth mentioning, I have VirtualBox 5.0.28 and vagrant 1.8.1.

@alcohol

This comment has been minimized.

Copy link
Member

commented Oct 26, 2016

Not really worth mentioning since we do not maintain virtualbox nor vagrant (though I doubt vagrant is at fault here, likely virtualbox).

@radutopala

This comment has been minimized.

Copy link
Author

commented Oct 26, 2016

Well .. even though composer maintainers are not tight to VirtualBox nor vagrant, other users may come across the same issue I had.

I just discovered that VirtualBox 5.0.28 is the cause!

And vagrant nicely downgraded VirtualBox to 5.0.10:

==>  Provider 'virtualbox' not found. We'll automatically install it now...
     The installation process will start below. Human interaction may be
     required at some points. If you're uncomfortable with automatically
     installing this provider, you can safely Ctrl-C this process and install
     it manually.
==>  Downloading VirtualBox 5.0.10...
     This may not be the latest version of VirtualBox, but it is a version
     that is known to work well. Over time, we'll update the version that
     is installed.

Now the test is decoding correctly the gzip-ed content every time:

vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!
vagrant@box:~$ php test.php
Retry 0 | Decoded successfully!

So .. the solution is to let vagrant install the right VirtualBox version.

@jaumesala

This comment has been minimized.

Copy link

commented Oct 28, 2016

Just in case somebody is redirected here because of the zlib_decode() error while trying to update dependencies using composer update

[ErrorException]
  zlib_decode(): data error

I confirm the bug is related to VirtualBox, either 5.0.28 or 5.1.8 (last stable build at the moment) is affected.
As @radutopala points out, downgrading to 5.0.26 solves the problem.

I had the same problem in 3 different machines, macOS 10.10 and 10.12.
In all of them composer diagnose did not report any problem.

I did many tests, create clean VM instances of Laravel Homestead and installing the Laravel framework, forcing IPv4 in the VM, disabling ssl verification of packagist, etc...

Nothing worked until I downgraded to 5.0.26.

@ankrtl

This comment has been minimized.

Copy link

commented Oct 28, 2016

downgrading to 5.0.26 also works on OSX 10.11.6

@cbj4074

This comment has been minimized.

Copy link

commented Oct 28, 2016

@radutopala Brilliant! Indeed it is VirtualBox.

@jaumesala Great work pinpointing the latest specific VirtualBox version that does not exhibit this problem!

I just tried downgrading to VirtualBox 5.0.26 and sure enough, the problem no longer occurs. You two spared me hours of further frustration, and I deeply appreciate it.

Given that this does not seem to be a problem with Composer, I opened a thread on the VirtualBox forums. If nobody can offer a viable solution there, I'll open an actual bug report with VirtualBox.

https://forums.virtualbox.org/viewtopic.php?f=3&t=80396&p=376826

It would be helpful if other folks could visit the above thread and chime-in with guest OS version and any other information that might be useful to the VirtualBox developers.

@udaiveerS

This comment has been minimized.

Copy link

commented Oct 30, 2016

I had this error on Homestead image with Vagrant 1.8.1 and Virtual box 5.1.8 on Mac Os. Downgrading to Virtualbox 5.0.26 and composer update completes without a problem.

@mihhac

This comment has been minimized.

Copy link

commented Oct 31, 2016

Hi, I had the same problem. Downgrading VirtualBox from 5.1.8 to 5.1.6 helped.

@bassrock

This comment has been minimized.

Copy link

commented Oct 31, 2016

Same here there is definitely an issue with the latest virtual box and shared nfs folders.

@thats4shaw

This comment has been minimized.

Copy link

commented Nov 3, 2016

I encountered this issue today with the exact same setup as @udaiveerS. Downgrading VirtualBox to 5.1.6 solved it for me also.

@cbj4074

This comment has been minimized.

Copy link

commented Nov 4, 2016

@mihhac @thats4shaw Good to know that 5.1.6 is the latest version of the 5.1 branch that doesn't suffer from this problem.

Does anyone have the networking expertise to chime-in on the VirtualBox thread at https://forums.virtualbox.org/viewtopic.php?f=3&t=80396&p=376826 ? That would be hugely helpful to the rest of us. :)

@Ingramz

This comment has been minimized.

Copy link

commented Nov 4, 2016

@cbj4074 it's highly unlikely you will find such people here 😆 , but if you give VirtualBox guys a way to reproduce this issue, they'll figure it out themselves.

Start by specifying your host and guest operating systems, then either use a prebuilt virtual machine available online or specify you installed it from an image. After that add the commands they need to run to get php and the test script running on the box and what the expected and actual outcomes are.

@cbj4074

This comment has been minimized.

Copy link

commented Nov 4, 2016

@Ingramz Thanks! All great advice. Maybe I can dedicate a couple of hours to this today.

I would really like to eliminate PHP from the equation entirely. Maybe it is a distraction from the underlying issue. If we could simply demonstrate that files cannot reliably be "gunzipped", regardless of their source, that would be ideal.

But maybe PHP is part of the problem. I do find it curious that the OS itself wouldn't barf in the nearest trash can if gunzipping failed across-the-board. Presumably gzip is used all over the place, from the package manager to log-rotation.

@Ingramz

This comment has been minimized.

Copy link

commented Nov 4, 2016

@cbj4074 as far as I know it doesn't matter what you give them, the first thing they will look at are recent changes by performing a binary search on the commits. They probably know better themselves where to look after that.

@magnetik

This comment has been minimized.

Copy link

commented Nov 7, 2016

Maybe it's worth taking a look at the strace output of the test script: https://gist.github.com/magnetik/82a9d1d9c34401b6268ba07a949cc491#file-strace-txt

Looking at the end, it only looks like the connection is interrupted ?.

@alcohol

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

@magnetik can you reproduce that consistently though?

@magnetik

This comment has been minimized.

Copy link

commented Nov 7, 2016

When running the script in the gist, the first 3-20 tries fails. Not consistently.

I'm using sury PPA

> % php -v
PHP 7.0.12-1+deb.sury.org~xenial+1 (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.12-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
@alcohol

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

What do you mean, except for the last one? It has an exit() in the else branch, so it should abort after the first failure. Not sure what the purpose of $retries is, since the implementation has no proper loop nor check.

@magnetik

This comment has been minimized.

Copy link

commented Nov 7, 2016

I've edited my answer since it was not clear enough. Sometimes it decodes successfully after 3 tries, sometimes after 20 tries.

I've logged the output of the file_get_content, when it fails it's 3KB, and the successful it 4KB.

I've added the log in the gist :

@alcohol

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

Can you try running your script against https://dump.robbast.nl/tmp.json ?

@magnetik

This comment has been minimized.

Copy link

commented Nov 7, 2016

5 requests fails over 20.

@alcohol

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

And on my host?

@magnetik

This comment has been minimized.

Copy link

commented Nov 7, 2016

Same, maybe a little less, I had 3 fails in 35 requests

@alcohol

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

Weird, unable to reproduce it myself. I see all your requests and they all seem to succeed (assuming the connection reset occurs after connecting). I count 56 requests.

@magnetik

This comment has been minimized.

Copy link

commented Nov 7, 2016

When using curl directly, I've always the same size :
curl https://packagist.org/p/lncd/oauth2%244010b595abf2d3c3a38b84ffd41f6a4a1587c4a54886559347b686a5e0116355.json 2>/dev/null | wc -m

Given that virtualbox 5.1.6 did not had the issue, it should be something on that side that is closing the connection too early.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

curl by default doesn't use gzip though for example, and maybe other parameters are different. At least try with --compressed to enable gzip.

@magnetik

This comment has been minimized.

Copy link

commented Nov 7, 2016

I've an answer from virtualbox, and it seems to be on their side : https://forums.virtualbox.org/viewtopic.php?f=3&t=80396#p377627

Thanks for the input that allowed to pinpoint the issue on their side.

Let's continue the discussion there.

@josecelano

This comment has been minimized.

Copy link

commented Nov 9, 2016

I had the same problem. Fixed downgrading VirtualBox to Version 5.0.26.

Host:
Windows 8.1 Pro
VirtualBox: VirtualBox-5.1.8          <- IT DOES NOT WORK
VirtualBox: Version 5.0.26 r108824    <- IT WORKS
Guest:
Ubuntu 16.04.1 LTS
PHP: PHP 5.6.27-1+deb.sury.org~xenial+1 (cli)

Some contributor should add this solution more visible in the issue #4121 (comments are closed). Google points your first to the other issue.

@radutopala

This comment has been minimized.

Copy link
Author

commented Nov 9, 2016

At least we can reference #4121 here.

@magnetik

This comment has been minimized.

Copy link

commented Nov 10, 2016

Issue is fixed for me for the to be released Virtualbox 5.1.9.

You can try it yourself with Virtualbox test build > 111846 https://www.virtualbox.org/wiki/Testbuilds

@kcaporaso

This comment has been minimized.

Copy link

commented Nov 11, 2016

@magnetik, confirmed it myself as well. VirtualBox 5.1.9 development build resolved my issue. Thanks everyone!

lo5an added a commit to OULibraries/vagrant_infrastructure that referenced this issue Nov 15, 2016

Suggest 5.1.6 as virtual box release
Virtualbox has some buggy releases that break some network junk. See [this composer issue](composer/composer#5814) for an example.
@hectornguyen

This comment has been minimized.

Copy link

commented Nov 18, 2016

Jesus christ!
How Virtualbox version affects to composer update ??? I have to reinstall my Vagrant box over and over until I found this issue....

VirtualBox 5.0.28 should be eliminated from Earth. Thank Oracle.

@stof

This comment has been minimized.

Copy link
Contributor

commented Nov 18, 2016

@hectornguyen Virtualbox had a bug breaking HTTP traffic using Gzip.
And composer update can precisely make HTTP requests to servers using Gzip on the JSON responses.

@markbennett1973

This comment has been minimized.

Copy link

commented Dec 20, 2016

This is now working fine for me after upgrading to VirtualBox 5.0.30, so it looks like Oracle have fixed it now.

@psgganesh

This comment has been minimized.

Copy link

commented Dec 26, 2016

Virtualbox 5.0.30 r112061 worked well in my case...

@Oliboy50

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2017

Virtualbox 5.1.14 r112924 (currently the latest release) works too

@brazorf

This comment has been minimized.

Copy link

commented Jun 18, 2017

Im still having this issue with 5.1.22 r115126 on windows host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.