11

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
Nik
  • 161
  • 1
  • 5
  • To follow your guide, scroll down to the section about the database connection string. The console will prompted questions during composer install process. Have you answer it or just leave it off? – Gary Liu Jul 29 '15 at 09:06
  • I have answered these questions. But I have to answer them quickly. If I wait too long, I guess about 30 seconds, then the script aborts with a [RuntimeException] Aborted message. Perhaps this helps finding the cause – Nik Jul 30 '15 at 06:36
  • its seem timeout process when try run `exec(sprintf('taskkill /F /T /PID %d 2>&1', $this->getPid()), $output, $exitCode);` you should check no pid conflict or you can restart Azure (if possible) and try again. – hendrathings Dec 03 '15 at 14:17

4 Answers4

3

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.

Gary Liu
  • 13,758
  • 1
  • 17
  • 32
  • I followed your steps exactly and ran into the same error again. When cleaning the cache I get the unable to kill the process exception. With a clean new webapp and a clean new symfony project... – Nik Aug 04 '15 at 08:38
  • Actually, I set `process-timeout` to a very small number like 2 when I could reproduce your issus. So I suspected that was the key to problem. Have you tried to set `process-timeout` to a large number? – Gary Liu Aug 04 '15 at 09:00
  • I tried setting the process-timeout to 0 as well as to 3600. In both cases the same issue. – Nik Aug 04 '15 at 12:12
3

I got the same error while trying to repro it. Timeout was caused by installing these 2 items:

"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache", "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",

Tried a work around:

  1. Remove ClearCache and InstallAsset from composer.json, installation is success

  2. Add these 2 components back, install again, it worked.

  3. There was a warning about Symbolic link because Windows does not support symbolic link. This should be different issue.

3

FYI

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

3

FYI

Here is the official Symfony download site, https://symfony.com/doc/current/book/installation.html#installing-the-symfony-installer

To install on Azure, follow the download instruction for windows. Hope it can help.