Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't create new Laravel project - unzip -qq exceeded timeout of 300

I have small project made in symfony2 when I try to build it on my server it's always fails when unzipping symfony. Build was OK and suddenly composer won't unzip symfony and I didn't change anything. I tried to build with Jenkins and also manually from bash with same result. It's not permissions problem and also internet connection on my server is OK.

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
 - Installing symfony/symfony (v2.3.4)
 Downloading: 100%
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "unzip '/path/vendor/symfony/symfony/6116f6f3
d4125a757858954cb107e64b' -d 'vendor/composer/b2f33269' && chmod -R u+w 'vendor/composer/b2f33269'" exceeded the timeout of 300 seconds.
like image 928
zajca Avatar asked Sep 20 '13 13:09

zajca


4 Answers

try composer update/install -o -vvv and check wether the package is being loaded from composer's cache.

if yes try clearing composer's cache or try adding -cache-dir=/dev/null.

To force downloading an archive instead of cloning sources, use the --prefer-dist option in combination with --no-dev.

Otherwise you could try raising composer's process timeout value:

export COMPOSER_PROCESS_TIMEOUT=600   ( defaults to 300 )
like image 79
Nicolai Fröhlich Avatar answered Oct 01 '22 16:10

Nicolai Fröhlich


composer config --global process-timeout 2000
like image 32
Ali Motameni Avatar answered Oct 01 '22 16:10

Ali Motameni


The easiest method is add config option to composer.json file, Add process-timeout 0, That's all. It works anywhere.

{
  .....
  "scripts": {
    "start": "php -S 0.0.0.0:8080 -t public public/index.php"
  },
  "config": {
    "process-timeout":0
  }
}
like image 35
riguang zheng Avatar answered Oct 01 '22 14:10

riguang zheng


Composer itself impose a limit on how long it would allow for the remote git operation. A look at the Composer documentation confirms that the environment variable COMPOSER_PROCESS_TIMEOUT governs this. The variable is set to a default value of 300 (seconds) which is apparently not enough for a large clone operation using a slow internet connection.

Raise this value using:

COMPOSER_PROCESS_TIMEOUT=2000 composer install
like image 26
Tahir Yasin Avatar answered Oct 01 '22 16:10

Tahir Yasin