S
S
silentvick2013-12-01 14:17:54
Composer
silentvick, 2013-12-01 14:17:54

Why does composer update hang?

Here's a composer.json (taken from Silex Skeleton ):

{
    "name": "fabpot/silex-skeleton",
    "description": "A pre-configured skeleton for the Silex microframework",
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.3.3",
        "silex/silex": "~1.1",
        "silex/web-profiler": "~1.0",
        "symfony/browser-kit": "~2.3",
        "symfony/class-loader": "~2.3",
        "symfony/config": "~2.3",
        "symfony/console": "~2.3",
        "symfony/css-selector": "~2.3",
        "symfony/debug": "~2.3",
        "symfony/finder": "~2.3",
        "symfony/form": "~2.3",
        "symfony/monolog-bridge": "~2.3",
        "symfony/process": "~2.3",
        "symfony/security": "~2.3",
        "symfony/translation": "~2.3",
        "symfony/twig-bridge": "~2.3",
        "symfony/validator": "~2.3",
        "doctrine/dbal": "2.2.*"
    },
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "1.1.x-dev"
        }
    },
    "minimum-stability": "dev"
}

Added doctrine/dbalBut at startup composer updatethe process hangs. Writes:
Loading composer repositories with package information
Installing dependencies (including require-dev)

And nothing else happens. I left it for about 20 minutes, the result is the same.
Composer version latest, machine is Ubuntu 12.04 x64

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
silentvick, 2013-12-03
@silentvick

In general, with the help of the flag --profile, it was possible to establish the cause. Everything rested on a lack of memory. I increased the amount of RAM to 1GB (it was 384MB) and the update completed successfully. The peak memory usage was 569.84MB.
Additionally, for those who in the future will encounter a similar problem, on github I found another possible reason for this hang. Its essence, as I understand it, is that with a large number of dependencies, the composer can "freeze" due to the large number of their possible combinations. This happens very rarely, but theoretically possible. The solution in this case is to set the requirements more strictly. For example, use a more specific version framework, or generally specify the exact version.

N
Nikita Gusakov, 2013-12-01
@hell0w0rd

Composer latest version - after selfupdate? Try to install the latest release, without updating, if so

I
ILYA, 2015-04-27
@iliacmd

It can also hang if bower is used, but it is not installed on the system. ( + corny can block the firewall connection )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question