composer: Composer Update silently returns "Killed"
Hi there,
when I try to execute the composer update command I got a generic Killed result. After same tests I follow the Symfony and Composer guidelines to make a fresh installation of the framework entirely from the composer. Here’s my steps and the resulting output:
$ composer create-project symfony/framework-standard-edition ./ 2.2.1 --prefer-dist
Installing symfony/framework-standard-edition (v2.2.1)
- Installing symfony/framework-standard-edition (v2.2.1)
Loading from cache
Created project in ./
Loading composer repositories with package information
Installing dependencies from lock file
- Installing doctrine/lexer (v1.0)
Loading from cache
- Installing doctrine/annotations (v1.1)
Loading from cache
- Installing doctrine/cache (v1.0)
Loading from cache
- Installing doctrine/collections (v1.1)
Loading from cache
- Installing twig/twig (v1.12.2)
Loading from cache
- Installing psr/log (1.0.0)
Loading from cache
- Installing doctrine/inflector (v1.0)
Loading from cache
- Installing doctrine/common (2.4.0-RC1)
Loading from cache
- Installing symfony/symfony (v2.2.1)
Loading from cache
- Installing jdorn/sql-formatter (v1.2.0)
Loading from cache
- Installing doctrine/dbal (2.3.3)
Loading from cache
- Installing doctrine/doctrine-bundle (v1.2.0-beta1)
Loading from cache
- Installing doctrine/orm (2.3.3)
Loading from cache
- Installing jms/cg (1.0.0)
Loading from cache
- Installing phpoption/phpoption (1.2.0)
Loading from cache
- Installing jms/parser-lib (1.0.0)
Loading from cache
- Installing jms/metadata (1.3.0)
Loading from cache
- Installing jms/aop-bundle (1.0.0)
Loading from cache
- Installing jms/di-extra-bundle (1.3.0)
Loading from cache
- Installing jms/security-extra-bundle (1.4.0)
Loading from cache
- Installing sensio/distribution-bundle (v2.2.1)
Loading from cache
- Installing sensio/framework-extra-bundle (v2.2.1)
Loading from cache
- Installing sensio/generator-bundle (v2.2.1)
Loading from cache
- Installing kriswallsmith/assetic (v1.1.0-alpha4)
Loading from cache
- Installing symfony/assetic-bundle (v2.1.2)
Loading from cache
- Installing monolog/monolog (1.4.1)
Loading from cache
- Installing symfony/monolog-bundle (v2.2.0)
Loading from cache
- Installing swiftmailer/swiftmailer (v4.3.0)
Loading from cache
- Installing symfony/swiftmailer-bundle (v2.2.0)
Loading from cache
- Installing twig/extensions (v1.0.0)
Loading from cache
kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the integration with the lessphp LESS compiler)
kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the integration with the scssphp SCSS compiler)
kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provides the integration with the SCSS compass plugin)
kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides the integration with phpcssembed to embed data uris)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
Generating autoload files
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for Acme\DemoBundle into web/bundles/acmedemo
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
$ composer install
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating autoload files
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for Acme\DemoBundle into web/bundles/acmedemo
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Killed
Trying to require an external library I got the same error:
$ composer require "gregwar/image-bundle:dev-master"
composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Killed
I’ve the latest composer available versione and the diagnose tell me all is OK.
How can I make it works? Or how can I get more informations on the error?
Thanks in advance!
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 27 (2 by maintainers)
Another DigitalOcean fix that does not require extra memory - activating swap, here’s an example for 1gb:
UPD since this comment gets some attention I’d like to update it: the above solution will work untill the next reboot, after that the swap would have to be reactivated. To persist it between reboots add the swap file to fstab:
sudo nano /etc/fstab
, the line to add for above file is/var/swap.1 swap swap sw 0 0
No problem, but just so you know, you typically should run
update
on your machine, then commit/deploy the composer.lock file and only runinstall
on your server to sync up the dependencies with the lock file, to make sure you only get stuff you tested properly. That way you can also run a server with low memory without any problems.My guess is “Killed” means the machine ran out of memory and oom-killer or a similar thing depending on your OS decided to kill the composer process.
If you are experiencing this problem on an AWS EC2 instances, the solution is just to create a swap file and enable it, as explained in https://stackoverflow.com/questions/17173972/how-do-you-add-swap-to-an-ec2-instance:
When I have this kind of problem with composer, I just add some swap memory and it works. For Ubuntu, I like to follow this tutorial that explains the steps very well:
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
For what it’s worth, I experienced this using
composer install
on a DigitalOcean droplet with 512mb memory for the droplet. After increasing the memory limit of the droplet to 1gb, the issue went away.@bcat-eu Thank you
It saved my time and efforts thanks
@bcat-eu thanks bro, helped me
@bcat-eu Thank you so much!
@bcat-eu Thanks it works!
@anacicconi thanks! you save my life.
All problems can have different sollutions. This was mine. After Killed appeared, both on Vagrant and on OSX, I tried the following:
On the vagrant: sudo composer update – failed
On osx: sudo composer update – success