ElasticBeanstalk, deployment error: command hooks (directoryHooksExecutor.py --path / opt / elasticbeanstalk / hooks / appdeploy / pre /) failed

get this error:

Command hooks (directoryHooksExecutor.py --path /opt/elasticbeanstalk/hooks/appdeploy/pre/) failed 

after trying to deploy through git aws.push.

Deployment fails, the following events are thrown:

2014-05-20 15:41:46 UTC-0700 ERROR [Instance: i-808b90df Module: AWSEBAutoScalingGroup ConfigSet: null] The command did not complete on the instance. Return code: 1 Conclusion: an error occurred during build: command interceptors failed. 2014-05-20 15:41:43 Error script UTC-0700 / opt / elasticbeanstalk / hooks / appdeploy / pre / 10_bundle_install.sh failed with error code 1

This is the error log:

 2014-05-20 22:41:43,767 [ERROR] Command hooks (directoryHooksExecutor.py --path /opt/elasticbeanstalk/hooks/appdeploy/pre/) failed 2014-05-20 22:41:43,768 [DEBUG] Command hooks output: 2014-05-20 22:41:43,768 [ERROR] Error encountered during build of Hook-PreAppDeploy: Command hooks failed Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 511, in run_config CloudFormationCarpenter(config, self._auth_config).build(worklog) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 247, in build changes['commands'] = CommandTool().apply(self._config.commands) File "/usr/lib/python2.6/site-packages/cfnbootstrap/command_tool.py", line 113, in apply raise ToolError(u"Command %s failed" % name) ToolError: Command hooks failed 2014-05-20 22:41:43,795 [ERROR] Unhandled exception during build: Command hooks failed Traceback (most recent call last): File "/opt/aws/bin/cfn-init", line 122, in <module> worklog.build(detail.metadata, configSets) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 117, in build Contractor(metadata).build(configSets, self) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 502, in build self.run_config(config, worklog) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 511, in run_config CloudFormationCarpenter(config, self._auth_config).build(worklog) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 247, in build changes['commands'] = CommandTool().apply(self._config.commands) File "/usr/lib/python2.6/site-packages/cfnbootstrap/command_tool.py", line 113, in apply raise ToolError(u"Command %s failed" % name) ToolError: Command hooks failed 2014-05-20 23:35:04,652 [DEBUG] CloudFormation client initialized with endpoint https://cloudformation.us-west-1.amazonaws.com 2014-05-20 23:35:04,653 [DEBUG] Describing resource AWSEBAutoScalingGroup in stack arn:aws:cloudformation:us-west-1:040951787496:stack/awseb-e-yz93miu6ma-stack/1bd7f720-da3f-11e3-a5f1-50fa003f9896 

Any ideas?

thanks

+7
amazon-web-services elastic-beanstalk deployment amazon-elastic-beanstalk
source share
4 answers

I encountered a similar problem on bundle_install.sh, use

 $> eb logs 

and check your /var/log/directory-hooks-executor.log , it fails to install gem 'forem' for me.

+11
source share

I published in a beanstalk development environment in which there was a typo in the web.config file, so none of the websites even worked with the web.config corruption error. This damaged the EC2 instance behind my beanstalk 1 instance environment, which is not recoverable. I fixed the typo, but only received this error message when posting.

I tried to restart the beanstalk. Tried to restart EC2 instances behind the beanstalk. I even tried to restore an older, but working version, using application version recovery in the section: beanstalk / environment name / application version.

None of this worked.

Decision:

In EC2 management, I destroyed an instance of EC2 behind a beanstalk. The beanstalk then automatically re-creates the new EC2 instance. Once this was completed, I was able to publish again without this error.

+2
source share

I got a similar error: /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed with returncode 255 it turns out that it was the culprit composer.

Logs are found in /var/log/directory-hooks-executor.log :

 2015-01-19 15:13:33,537 [INFO] (29969 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/ pre/10_composer_install.sh + '[' -f composer.json ']' + echo 'Found composer.json file. Attempting to install vendors.' Found composer.json file. Attempting to install vendors. + composer.phar install --no-ansi --no-interaction --no-dev --prefer-dist Loading composer repositories with package information PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///opt/elasticbeanstalk/support/composer.phar/ vendor/symfony/console/Symfony/Component/Console/Application.php:975 #1 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(975): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array) #2 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(853): Symfony\Component\Console\Application-> getSttyColumns() #3 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(818): Symfony\Component\Console\Application-> getTerminalDimensions() #4 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Applicat in phar:///opt/elasticbeanstalk/support/composer.phar/vendor/ symfony/console/Symfony/Component/Console/Application.php on line 975 Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///opt/elasticbeanstalk/support/composer.phar/vendor/ symfony/console/Symfony/Component/Console/Application.php:975 #1 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(975): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array) #2 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(853): Symfony\Component\Console\Application-> getSttyColumns() #3 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(818): Symfony\Component\Console\Application-> getTerminalDimensions() #4 phar:///opt/elasticbeanstalk/support/composer.phar/vendor/symfony/console/Symfony/Component/Console/Applicat in phar:///opt/elasticbeanstalk/support/composer.phar/vendor/ symfony/console/Symfony/Component/Console/Application.php on line 975 2015-01-19 15:20:06,267 [ERROR] (29969 MainThread) [directoryHooksExecutor.py-33] [root directoryHooksExecutor error] Script /opt/elasticbeanstalk/hooks/appdeploy/ pre/10_composer_install.sh failed with returncode 255 

According to this github issue, the ways to fix this is to increase memory_limit in php.ini.

+1
source share

I just solved a similar error. It seems that Elastic Beanstalk was unable to cope with the poor state on one of the instances and simply could not deploy it, which caused general instability in the EB environment.

I resolved this by reducing the number of instances to 1 and redistributing it. This left only one good example, killed the problematic and solved the problem.

+1
source share

All Articles