Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout with the Symfony Framework #476

Closed
web-dev opened this issue Mar 19, 2012 · 44 comments
Closed

Timeout with the Symfony Framework #476

web-dev opened this issue Mar 19, 2012 · 44 comments
Labels

Comments

@web-dev
Copy link

web-dev commented Mar 19, 2012

When using composer to manage the dependencies of the Symfony framework the script times out.

$ COMPOSER_PROCESS_TIMEOUT=300 ./composer.phar update
Updating dependencies
  - Package symfony/symfony (dev-master)
    Cloning edac48a824bd04718a346890ca225ee28d2a347b



  [RuntimeException]      
  The process timed out.  
@cordoval
Copy link
Contributor

please paste your composer.json

@web-dev
Copy link
Author

web-dev commented Mar 19, 2012

{
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.2",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": "2.2.0",
        "doctrine/doctrine-bundle": "dev-master",
        "twig/extensions": "dev-master",
        "symfony/assetic-bundle": "dev-master",
        "symfony/swiftmailer-bundle": "dev-master",
        "symfony/monolog-bundle": "dev-master",
        "sensio/distribution-bundle": "dev-master",
        "sensio/framework-extra-bundle": "dev-master",
        "sensio/generator-bundle": "dev-master",
        "jms/security-extra-bundle": "dev-master",
        "friendsofsymfony/user-bundle": "dev-master",
        "twitter/bootstrap": "2.0.1",
        "knplabs/knp-menu-bundle": "dev-master",
        "ornicar/gravatar-bundle": "dev-master",
        "behat/behat-bundle": "*",
        "behat/mink-bundle": "*",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "mockery/mockery": ">=0.7.2"
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "twitter/bootstrap",
                "version": "2.0.1",
                "dist": {
                    "url": "https://github.com/twitter/bootstrap/zipball/v2.0.1",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/twitter/bootstrap.git",
                    "type": "git",
                    "reference": "v2.0.1"
                }
            }
        },
        {
            "type": "composer",
            "url": "behat.org"
        }
    ],
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

@cordoval
Copy link
Contributor

it is your network definitely

~ composer install
Installing dependencies
  - Package behat/gherkin (v2.1.1)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package behat/behat (dev-master)
    Cloning 612f642a46b94daab40820192667f58ec3463132

  - Package mockery/mockery (dev-master)
    Cloning 2c5e3244b72d268d8c70935fcceb39b3d84d57db

  - Package behat/behat-bundle (dev-master)
    Cloning 55ede38ec9694d67c7bc51e910f7009978421a56

  - Package doctrine/data-fixtures (dev-master)
    Cloning aea0b95a554188892f10d8f09ce3ae8150f28f8b

  - Package kriswallsmith/buzz (dev-master)
    Cloning b88c3a4b22f74cd90f4457f3049ecffaf39d3052

  - Package behat/sahi-client (dev-master)
    Cloning v1.0.1

  - Package zendframework/zend-registry (2.0.0beta3)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package zendframework/zend-loader (2.0.0beta3)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package zendframework/zend-stdlib (2.0.0beta3)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package zendframework/zend-validator (2.0.0beta3)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package zendframework/zend-http (2.0.0beta3)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package zendframework/zend-uri (2.0.0beta3)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package fabpot/goutte (master-dev)
    Cloning master

  - Package alexandresalome/php-selenium (master-dev)
    Cloning master

  - Package facebook/php-webdriver (master-dev)
    Cloning master

  - Package behat/mink (dev-master)
    Cloning edbee099723b1b94cd56651ae4667d647d31e36e

  - Package knplabs/knp-menu (dev-master)
    Cloning f7970583d4da8776c037e2d49878d8160361e373

  - Package monolog/monolog (1.0.2)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package swiftmailer/swiftmailer (4.1.5)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package kriswallsmith/assetic (dev-master)
    Cloning 2634d29cc193981761e3daf28e1afc6358bb43b1

  - Package twig/twig (1.6.2)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package doctrine/common (2.2.1)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package jms/cg (1.0.0)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package jms/metadata (1.1.1)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package jms/aop-bundle (1.0.0)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package symfony/swiftmailer-bridge (dev-master)
    Cloning 23b8d5c049bb3dfb67ec04bbea09464da27c4ec7

  - Package doctrine/dbal (2.2.1)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package doctrine/doctrine-fixtures-bundle (dev-master)
    Cloning 0e4e56b1da7981bcc7729e0f301a75195d34df18

  - Package behat/mink-bundle (dev-master)
    Cloning 4f68c897b5a0b0414d3fad9b282a2a8885136cad

  - Package ornicar/gravatar-bundle (dev-master)
    Cloning e5aedca3bd066081e16912ca8be96ba4ca570d0a

  - Package knplabs/knp-menu-bundle (dev-master)
    Cloning c20933d2b988a3bd0944a0fd9e00068c30f0d27f

  - Package twitter/bootstrap (2.0.1)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package friendsofsymfony/user-bundle (dev-master)
    Cloning a0e50724825fd73531a563f514168d8536b9187e

  - Package jms/security-extra-bundle (dev-master)
    Cloning 36c698d3e22241a97b55422dc963ba2cc041fb3a

  - Package sensio/generator-bundle (dev-master)
    Cloning 43c5c95e42e451ac7250d6a863f0540c7f266e1d

  - Package sensio/framework-extra-bundle (dev-master)
    Cloning 6e3cccb66d3577fdbd5b6935a5d6b8bed8d47768

  - Package sensio/distribution-bundle (dev-master)
    Cloning 12882a093af81f89ac13078904e81c308784e883

  - Package symfony/monolog-bundle (dev-master)
    Cloning 289442e385e7c0fe4aa2e8884d11e774a8f9ad99

  - Package symfony/swiftmailer-bundle (dev-master)
    Cloning 75f8f95c201922a966274547131b33291d15d51b

  - Package symfony/assetic-bundle (dev-master)
    Cloning b9cff021abc3d9433a892fa9908d9856393c0d09

  - Package twig/extensions (dev-master)
    Cloning 1dfff8e793f50f651c4f74f796c2c68a4aee3147

  - Package doctrine/doctrine-bundle (dev-master)
    Cloning 90e39fb7ff5b4c13577602dab7e08c90067160b4

  - Package doctrine/orm (2.2.0)
    Downloading               
    Unpacking archive
    Cleaning up

  - Package symfony/symfony (dev-master)
    Cloning edac48a824bd04718a346890ca225ee28d2a347b


Writing lock file
Generating autoload files
The symfony-app-dir (app) specified in composer.json was not found in /home/cordoval/sites-2/temp/josiah, can not build bootstrap file.
The symfony-app-dir (app) specified in composer.json was not found in /home/cordoval/sites-2/temp/josiah, can not clear the cache.
The symfony-web-dir (web) specified in composer.json was not found in /home/cordoval/sites-2/temp/josiah, can not install assets.

@web-dev
Copy link
Author

web-dev commented Mar 20, 2012

The network that I'm on isn't terrible, using bin/vendors with symfony works fine - and it was only recently that composer stopped working.

@cordoval
Copy link
Contributor

+1

@web-dev
Copy link
Author

web-dev commented Mar 20, 2012

I've done some more digging on this and I've found that composer is incorrectly calling download rather than update for the repository. I will continue investigating and post another issue when I find the cause.

@dbu
Copy link
Contributor

dbu commented Apr 18, 2012

is this still relevant?

@cordoval
Copy link
Contributor

he already solved it @dbu

@dbu
Copy link
Contributor

dbu commented Apr 18, 2012

then this issue should be closed (the closed thing about my comment is about #478, not about this one)

@web-dev web-dev closed this as completed Apr 19, 2012
@pajooh
Copy link

pajooh commented May 16, 2012

same error with latest version of symfony-standard(dev-master) and composer(799a478), with the default composer.json

@dbu
Copy link
Contributor

dbu commented May 16, 2012

i think this is to blame on github or your network connection. it usually works but if github is down or you can't reach it or it takes forever, it fails.

does composer do anything about timeouts? if so it should maybe use more tolerant delays.

@stof
Copy link
Contributor

stof commented May 16, 2012

IIRC, the default timeout is set to 5 minutes in composer now for each process launched. Making it longer seems overkill (especially as you can increase it manually if you want a longer timeout)

@pajooh
Copy link

pajooh commented May 16, 2012

actually my network connection is slow, but the bin/vendors script works fine.
I think the problem is on composer (or its repositories) side

@Burgov
Copy link

Burgov commented May 16, 2012

I run into this when I work from home and have a VPN open to my office, which of course makes internet rather slow. Downloading the whole symfony repo then times out

@pajooh
Copy link

pajooh commented May 24, 2012

still struggling with the issue :-(
something that may help: based on my observations, setting the exact tag version instead of some development branch works much faster.
e.g. replacing doctrine/dbal version from 2.2.x-dev to 2.2.2

@web-dev web-dev reopened this Jun 29, 2012
@web-dev
Copy link
Author

web-dev commented Jun 29, 2012

I'm experiencing this issue again (on slow internet connection - roughly 30-60 KiB/s).

This isn't the firs time since it was closed that I've experienced it. It occurs whenever I attempt to setup a new project on a slow internet connection. Existing projects work fine because there's not that much to download.

When I clone the SF2 repo directly into the vendors/symfony/symfony folder it works fine, however composor ignores the existing source and tries again.

Cloning a repository as large as symfony takes roughly 10 - 15 minutes on my slow internet connection. A process timeout that covers the download time makes no sense - its an arbitrary limit for a process that may take longer depending on size of the dependency being downloaded.

@purplefish32
Copy link

I am having the same issues

@lyle-nel
Copy link

lyle-nel commented Jul 4, 2012

You could try increasing the timeout value.
eg. "COMPOSER_PROCESS_TIMEOUT=4000 php composer.phar install"
Works for me.

@web-dev
Copy link
Author

web-dev commented Jul 4, 2012

@evolvePsi I have this in place - It's the only way that I can create new projects with this internet connection.

However I think that an arbitrary time limit on a process that may take a shorter or longer period of time based upon the size of the repository isn't a solid solution. I'm perplexed as to why the timeout was introduced in the first place.

@lyle-nel
Copy link

lyle-nel commented Jul 5, 2012

I agree with you that it does seem like an odd design decision.
I posted a quick fix(well slow, considering the connection speed :) ) since I believe there are individuals that are only interested in getting it to work, including myself.

If I had to make an intuitive call on the design decision, I suspect it is intended to only start counting the timeout once there is no data transfered. I suspect it was not properly implemented, but I am just speculating.
Have you had a look at the code?

@stof
Copy link
Contributor

stof commented Jul 5, 2012

the timeout is mandatory in the stream_select API, and so it is also mandatory in the Process component which uses it. There is no way to have a process with an infinite timeout using stream_select.

@web-dev
Copy link
Author

web-dev commented Jul 5, 2012

What about having the timeout configured by the repository composer.json file.

That way larger repositories could set a 15 minute timeout or something.

@scuben
Copy link

scuben commented Jul 6, 2012

I am using composer now from the seychelles facing exactly this problem (slow inet). I will try evolvePsi's suggestion to work around that issue.

@cordoval
Copy link
Contributor

cordoval commented Jul 6, 2012

I am running into the same problem but here #690 when inside vagrant box
trying the following:

vagrant@precise64:/vagrant/www/KnpBundles$ COMPOSER_PROCESS_TIMEOUT=4000 php composer.phar install --dev -v

@thecatontheflat
Copy link

@pajooh Specifying of version did the trick for me. Thanks! :)

@lmcd
Copy link

lmcd commented Sep 26, 2012

Also having this problem

@teo-sk
Copy link

teo-sk commented Sep 27, 2012

+1, only on specific network, experiencing it on 1 of 3 networks I'm using.

@Seldaek
Copy link
Member

Seldaek commented Sep 29, 2012

You can now use composer install --prefer-dist to force zip installs which should be way faster if you have a slow connection.

@marcoalbarelli
Copy link

This bug affected me as well.
The --prefer-dist switch appears to have fixed it.
Thx

@MPLLC
Copy link

MPLLC commented Oct 25, 2012

composer update is practically unusable for me, even with the --prefer-dist option. My network connection isn't slow - I have ~12 Mbps downstream. Not sure what else to try, but it's very annoying as Composer is great when I can actually connect and download.

@KevinGaudin
Copy link

There should be at least some more details in the timeout error message giving clues to solve it.
Something like:

"The process timed out. If your network connection is slow or your project using a large number of heavy dependencies, you can try to either:

  • increase the timeout delay with: COMPOSER_PROCESS_TIMEOUT=4000 composer install
  • load zip installs instead of git repositories with the --prefer-dist option"

But I think that timeouts should be placed on networking operations, not on a whole process.

(PS: just creating a new Symfony project over a 20mbps connection, don't tell me it is slow ;-)

@stof
Copy link
Contributor

stof commented Oct 26, 2012

@KevinGaudin Having a timeout on the process is the way PHP proc_open works.

@MaerF0x0
Copy link

Just to add some info:
Network connection speed is not always the limiting factor, github.com often gives me slow down speeds (~100k/s and there are some very large repos on here such as https://github.com/pubnub/pubnub-api )

+1 for the idea of being able to define the timeout in the composer.json, allowing me to specify a large time and have install instructions of "composer install" instead of "COMP...OUT=10000 composer install"

@stof
Copy link
Contributor

stof commented Jan 23, 2013

there is already a way to do it in the composer.json: http://getcomposer.org/doc/04-schema.md#config

@vihuvac
Copy link

vihuvac commented Mar 15, 2013

@web-dev if you got your composer.lock already configured, you should run just composer.phar --prefer-dist

@DoobleD
Copy link

DoobleD commented Mar 27, 2013

@stof Thanks for pointing the link! Helped a lot (since I lost my internet connection, I have to use my phone 2G connection...).

@DoobleD
Copy link

DoobleD commented Mar 27, 2013

--prefer-dist even faster. o)

@emont01
Copy link

emont01 commented Apr 15, 2013

I had this problem, I tried to solve it changing the timeout with no luck.
Finally I managed to solve it using:

composer install --prefer-dist

@ricardo-rossi
Copy link

Ran into same timeout issue --prefer-dist also worked for me

@rphphd
Copy link

rphphd commented Aug 16, 2013

Still struggling with the time out even when using --prefer-dist. Seems to hang on the swift mailer bundle even when agreeing to discard changes (I don't remember changing the Swiftmailer bundle - some Git discussion on line-endings on Mac OSX did prompt me to make a Git global option change on handling line-endings)... I've never run into this issue before and I'm using a super high-speed internet modem/service from Cox Cable - doubt it's a network issue... Any suggestions? (I'm thinking Composer has gone into an infinite loop of some sort)

@rphphd
Copy link

rphphd commented Aug 16, 2013

Also tried deleting the composer.lock file and I still have the same result:

Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Updating swiftmailer/swiftmailer (v5.0.0 => v5.0.1)

    [Symfony\Component\Process\Exception\RuntimeException]
    The process timed-out.

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]


Going to run it with the verbose option to see if it sheds any more light...

@Seldaek
Copy link
Member

Seldaek commented Aug 16, 2013

@rphphd run with -vvv to get full details and especially the command that fails

@rphphd
Copy link

rphphd commented Aug 16, 2013

Nevermind.... DUH - multitasking.... I indadvertantly was trying to do the composer update on a remote volume. Switched to my local directory and everything worked. My problem solved

@sintetico82
Copy link

@ rphphd: Me too. Remote volume give me the same error time out!

@Seldaek Seldaek closed this as completed Jan 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests