Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unable to kill the process" error with "php composer.phar install" on Azure

Tags:

php

symfony

azure

I am trying to deploy my Symfony 2 application to the Microsoft Azure Website Cloud. For this I am following the steps from this guide http://symfony.com/doc/current/cookbook/deployment/azure-website.html#configure-the-symfony-application

Now, when I get to the step "Configure the Symfony Application" I run the command php composer.phar install. I omit the -d extension=php_intl.dllswitch as the extension is already loaded. I actually tried both, it doesn't make a difference.

Now, when running the post-install commands I get the following error:

[Symfony\Component\Process\Exception\RuntimeException]
Unable to kill the process                              

I tried increasing the max_execution_time (but it was set to 0 anyway) and also tried setting the SCM_COMMAND_IDLE_TIMEOUT parameter in app_settings to a value like 3600. Still not working.

Any ideas? Here is the full output:

D:\home\site\wwwroot>php composer.phar install
 Loading composer repositories with package information

Installing dependencies (including require-dev) from lock file

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

Nothing to install or update

Generating autoload files

> Incenteev\ParameterHandler\ScriptHandler::buildParameters

Updating the "app/config/parameters.yml" file

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception







  [Symfony\Component\Process\Exception\RuntimeException]  

  Unable to kill the process                              







install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-    progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]






Fatal error: Uncaught exception 'Symfony\Component\Process\Exception\RuntimeException' with message 'Unable to kill the process' in phar://D:/home/site/wwwroot    /composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php:801
Stack trace:
#0 phar://D:/home/site/wwwroot/composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php(177): Symfony\Component\Process\Process->stop()
#1 [internal function]: Symfony\Component\Process\Process->__destruct()
#2 {main}
  thrown in phar://D:/home/site/wwwroot/composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php on line 801
like image 253
Nik Avatar asked Jul 28 '15 09:07

Nik


2 Answers

I have tried to reproduce your issue, however failed, the composer ran well in my project on Azure. Please try the following steps:

1, Create a Web app on Azure with a MySQL Database and set up deployment from git.

2, Create a new symfony 2.7 project at local by cmdlet:

php -r "readfile('http://symfony.com/installer');" > symfony

symfony new my_project

then deploy the project on Web app.

3, Switch back to online console of Kudu application, execute the following command:

"cd site\wwwroot"

"curl -sS https://getcomposer.org/installer | php"

"php composer.phar install"

4, Answer the prompted questions during composer install process.

It works fine to me.

By the way, it seems there is something wrong about timeout RuntimeException when the composer was cleaning the cache in your project env. There are 2 ways to handle it:

1, We can clean the cache manually before deploy on Azure.

2, We can set command excute timeout option in composer.json. In the composer.Json file, there is the code:

"config": {
   "bin-dir": "bin",
   "process-timeout":0 
}, 

we add "process-timeout:0" to remove the limitation of command excute time.

like image 132
Gary Liu Avatar answered Nov 08 '22 22:11

Gary Liu


FYI

I tested one more time, it looks like composer.lock caused some issue. I deleted composer.lock, then ran install, it passed successfully.

like image 40
user4962020 Avatar answered Nov 08 '22 23:11

user4962020