Composer Issue + ” exceeded the timeout of 300 seconds “

GetComposer.org

GetComposer.org

I was installing this package from github and I came across the following issue:

– Installing doctrine/annotations (dev-master e93f3b7)
Cloning e93f3b718c421daddff58c4a4af1aee574472cd6
Failed to download doctrine/annotations from source: The process “git clone –no-checkout ‘git://github.com/doctrine/annotations.git’ ‘/var/www/pagekit.com/pagekit/vendor/doctrine/annotations’ && cd ‘/var/www/pagekit.com/pagekit/vendor/doctrine/annotations’ && git remote add composer ‘git://github.com/doctrine/annotations.git’ && git fetch composer” exceeded the timeout of 300 seconds.
Now trying to download from dist
– Installing doctrine/annotations (dev-master e93f3b7)
Loading from cache

I have tried to repeat this three times, but no success. By repeat I mean, first time $ composer install and then $ composer update

The Solution – Increase COMPOSER_PROCESS_TIMEOUT

Then I found the solution (after banging my head a bit) and I came across two worthwhile posts which set me on the right direction:

Based on these two alone, the possible solutions were:

  1. increase the COMPOSER_PROCESS_TIMEOUT – since composer by default set it to 300 secs (this is confirmed on the composer specs here itself)- as correctly suggested by my friend David Weinraub
  2. clear the composer’s cache or try adding -cache-dir=/dev/null IF the package is being loaded from composer’s cache

How To Diagnose the culprit?

It turns out that this command help a lot:
$ composer update  -vvv

A Better Solution – Use Satis

UPDATE:

My friend Hari KT on twitter suggested a better solution, that of using Satis (a Package Repository Generator) with composer. I’m yet to try this one out though.
You can find satis on github here: https://github.com/composer/satis

 Further Reading

This article is nice if you want to know how to use & understand Composer: Composer 101 by ServerGrove

 

 

I’m not yet so much versed with composer, this was only my 3rd practical encounter with Composer after watching NomadPHP‘s composer talks by Rafael Dohms (last year) and Beau Simensen (last year ). So if you have any more details or if you see you can add more to this, feel free to post a comment below.

If You Appreciate What I Do Here On Seven PHP :: 7PHP, You Could Consider:

  1. Following me on Twitter | @7php
  2. LIKE-ing my FaceBook page
  3. Subscribe to my Email List - see top-right subscription box
  4. Help diffuse this interview to the PHP ecosystem - Share & Spread the word as far as you can ==> That would be a FREE way to thank me
  5. Use my DigitalOcean referral link if you plan to use it as your VPS (it starts at only $5/month btw) or if you can refer it to your friends, highly appreciated.
  6. Support via Paypal donate - my Paypal ID is w@7php.com

{I'm thankful to your response(s)!}

Valuable Feedback / Comment / Review From People Like You

  1. When you work on a low bandwidth satis works great! . You can also turn off the packagist search so will be much faster .

Speak Your Mind

*