Composer throwing error while provisioning Vagrant

Hello,

This is the error I’m getting while booting up my Vagrant. Couldn’t find the solution.
I’m using default configuration only.

"stdout_lines": ["SlowTimer [31519ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7", "SlowTimer [31629ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7", "SlowTimer [32559ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7", "SlowTimer [31657ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7"], "warnings": []}
==> default: stderr: Loading composer repositories with package information
==> default: Installing dependencies (including require-dev) from lock file
==> default: Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
==> default:   - Installing johnpbloch/wordpress (4.3)
==> default:     Downloading: 100%
==> default: The "https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7" file could not be downloaded: Failed to open https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7 (Operation timed out after 29856 milliseconds with 1393743 out of 9395528 bytes received)
==> default: Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
==> default:     Downloading: 100%
==> default:     Downloading: 100%
==> default:     Downloading: 100%
==> default:     Failed to download johnpbloch/wordpress from dist: The "https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7" file could not be downloaded: Failed to open https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7 (Operation timed out after 29217 milliseconds with 1475488 out of 9395528 bytes received)
==> default:     Now trying to download from source
==> default:   - Installing johnpbloch/wordpress (4.3)
==> default:     Cloning 2afe902599538caaa0f1fd7579895dd7cc0ac5f7
==> default:
==> default:
==> default:                                                                                                                                                            
==> default:   [Symfony\Component\Process\Exception\ProcessTimedOutException]                                                                                           
==> default:   The process "git clone --no-checkout 'git://github.com/johnpbloch/wordpress.git' 'web/wp' && cd 'web/wp' && git remote add composer 'git://github.com/johnpbloch/wordpress.git' && git fetch composer" exceeded the timeout of 300 seconds.
==> default:                                                                                                                                                            
==> default:
==> default:
==> default:
==> default: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
==> default: stdout: SlowTimer [31519ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7
==> default: SlowTimer [31629ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7
==> default: SlowTimer [32559ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7
==> default: SlowTimer [31657ms] at curl: https://api.github.com/repos/johnpbloch/wordpress/zipball/2afe902599538caaa0f1fd7579895dd7cc0ac5f7
==> default:
==> default: PLAY RECAP ********************************************************************
==> default:            to retry, use: --limit @/root/dev.retry
==> default:
==> default: 127.0.0.1                  : ok=95   changed=6    unreachable=0    failed=1

Thanks.

It looks like the Vagrant box doesn’t have an internet connection. If you run vagrant ssh and then run ping google.com do you get return pings?

Yes, it does have Internet.

Never seen that error personally. But those URLs work for me so I can’t be of much help. Do they work if you manually try to wget or curl them from the Vagrant box?

Yes, they do.

I searched and read somewhere that it might be the problem of difference in versions.

Didn’t get it much.

Well you might as well take care of the outdated dependencies too.

Run composer update on the Vagrant box and then do composer install.

No luck. Couldn’t perform the update. Then also tried to perform install explicitly, got the following errors.

i think i should start from the scratch.

And ya, those urls works fine from Vagrant machine, if given with curl or wget.

Did you try composer update?