繁体   English   中英

aws弹性beanstalk作曲家突然失败

[英]aws elastic beanstalk composer suddenly fails

直到今天早上,我已经能够部署我的laravel应用程序而没有任何问题。 我没有使用composer进行任何更改,并且在.ebextensions文件夹中进行了以下设置

commands:
    001_update_composer:
        command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update

option_settings:
    - namespace: aws:elasticbeanstalk:application:environment
      option_name: COMPOSER_HOME
      value: /root

尝试部署时,实例日志中出现以下错误

[DEBUG] Action for aws-eb-command-handler output: {"status":"FAILURE","api_version":"1.0","truncated":"true","results":[{"status":"FAILURE","msg":"[CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/10_composer_install.sh] command failed with error code 1: /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh\n++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir\n+ EB_APP_STAGING_DIR=/var/app/ondeck\n+ cd /var/app/ondeck\n+ '[' -f composer.json ']'\n+ export COMPOSER_HOME=/root\n+ COMPOSER_HOME=/root\n+ '[' -d vendor ']'\n++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:php:phpini -o composer_options\n+ PHP_COMPOSER_OPTIONS=--no-dev\n+ echo 'Found composer.json file. Attempting to install vendors.'\nFound composer.json file. Attempting to install vendors.\n+ composer.phar install --no-ansi --no-interaction --no-dev\n\n                                                                                            \n  [RuntimeException]                                 ","returncode":1,"events":[]}]}

2016-01-19 03:40:10,193 [ERROR] Command 001_update_composer (export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update) failed
2016-01-19 03:40:10,194 [DEBUG] Command 001_update_composer output: 

  [RuntimeException]                                                                        
  The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly  


self-update [-r|--rollback] [--clean-backups] [--no-progress] [--] [<version>]


2016-01-19 03:40:10,194 [ERROR] Error encountered during build of prebuild_0_uo: Command 001_update_composer 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 001_update_composer failed
2016-01-19 03:40:10,223 [ERROR] Unhandled exception during build: Command 001_update_composer 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 001_update_composer failed

如果删除自我更新呼叫,则会出现此错误

ERROR: [Instance: i-4a696c53] Command failed on instance. Return code: 1 Output: [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/10_composer_install.sh] command failed with error code 1: /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh
++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
+ EB_APP_STAGING_DIR=/var/app/ondeck
+ cd /var/app/ondeck
+ '[' -f composer.json ']'
+ export COMPOSER_HOME=/root
+ COMPOSER_HOME=/root
+ '[' -d vendor ']'
++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:php:phpini -o composer_options
+ PHP_COMPOSER_OPTIONS=--no-dev
+ 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


  [RuntimeException]                                 .
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].

我遇到的任何事情我都没有成功尝试过。 无论部署版本如何,它都会在我的每个实例(甚至是一个不同的项目)上发生。 我可以在本地更新composer,也可以在有问题的服务器上更新ssh并手动进行更新。 我可以部署到今天早上为止,而且我什么都没做,所以我对可能的情况不知所措。 我在运行PHP 5.5的64位Amazon Linux 2014.09 v1.0.9上运行

这似乎与Composer本身有关。 https://github.com/composer/composer/issues/4789self-update后添加1.0.0-alpha11并添加- namespace: aws:elasticbeanstalk:application:environment option_name: HOME value: /rootoption_settings解决了此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM