简体   繁体   English

第一个git aws.push到弹性beanstalk时出错

[英]Error on first git aws.push to elastic beanstalk

I am new to Elastic Beanstalk and am trying to launch a Rails 4 app. 我是Elastic Beanstalk的新手,我正在尝试推出Rails 4应用程序。 I have followed the guide here http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-reference-get-started.html but when I go to do 我已经按照http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-reference-get-started.html这里的指南进行了操作但是当我去的时候

git aws.push

It tells me that my update had errors. 它告诉我,我的更新有错误。

[Instance: i-a6482b8b Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command hooks failed .

The ebs log is just jam packed with lots of confusing items I am not familiar with. ebs日志只是挤满了我不熟悉的许多令人困惑的项目。 It is hard to tell what to share but these two areas stood out 很难说分享什么,但这两个方面都很突出

  1. Lots of No's here so that isn't a great sign. 很多不在这里,所以这不是一个好兆头。 Also calls a bunch of python files which is confusing because I should be running 64bit Amazon Linux 2014.03 v1.0.4 running Ruby 2.0 (Passenger Standalone). 还调用了一堆令人困惑的python文件,因为我应该运行运行Ruby 2.0(Passenger Standalone)的64位Amazon Linux 2014.03 v1.0.4。

    14-09-22 05:31:28,375 [INFO] Running configSet Infra-WriteApplication2 2014-09-22 05:31:28,376 [INFO] Running config Infra-WriteApplication2 2014-09-22 05:31:28,376 [DEBUG] No packages specified 2014-09-22 05:31:28,376 [DEBUG] No groups specified 2014-09-22 05:31:28,377 [DEBUG] No users specified 2014-09-22 05:31:28,377 [DEBUG] No sources specified 2014-09-22 05:31:28,377 [DEBUG] Writing content to /opt/elasticbeanstalk/bin/download_source_bundle 2014-09-22 05:31:28,377 [DEBUG] Retrieving contents from https://s3.amazonaws.com/elasticbeanstalk-env-resources-us-east-1/eb_patching_resources/download_source_bundle.py 2014-09-22 05:31:28,624 [DEBUG] Setting mode for /opt/elasticbeanstalk/bin/download_source_bundle to 000750 2014-09-22 05:31:28,625 [DEBUG] Setting owner 0 and group 0 for /opt/elasticbeanstalk/bin/download_source_bundle 2014-09-22 05:31:28,625 [DEBUG] Running command 01downloadVersion 2014-09-22 05:31:28,626 [DEBUG] No test for command 01downloadVersion 2014-09-22 05:31:29,3 14-09-22 05:31:28,375 [INFO]运行configSet Infra-WriteApplication2 2014-09-22 05:31:28,376 [INFO]运行配置Infra-WriteApplication2 2014-09-22 05:31:28,376 [DEBUG]否指定包裹2014-09-22 05:31:28,376 [DEBUG]未指定群组2014-09-22 05:31:28,377 [DEBUG]未指定用户2014-09-22 05:31:28,377 [DEBUG]未指定来源2014-09-22 05:31:28,377 [DEBUG]将内容写入/ opt / elasticbeanstalk / bin / download_source_bundle 2014-09-22 05:31:28,377 [DEBUG]从https://s3.amazonaws.com/检索内容elasticbeanstalk-env-resources-us-east-1 / eb_patching_resources / download_source_bundle.py 2014-09-22 05:31:28,624 [DEBUG] / opt / elasticbeanstalk / bin / download_source_bundle设置模式为000750 2014-09-22 05: 31:28,625 [DEBUG]为/ opt / elasticbeanstalk / bin / download_source_bundle设置所有者0和组0 2014-09-22 05:31:28,625 [DEBUG]运行命令01downloadVersion 2014-09-22 05:31:28,626 [DEBUG]没有测试命令01downloadVersion 2014-09-22 05:31:29,3 54 [INFO] Command 01downloadVersion succeeded 2014-09-22 05:31:29,355 [DEBUG] Command 01downloadVersion output: 2014-09-22 05:31:29,355 [DEBUG] Running command 02deleteVersionDownloadScriptFile 2014-09-22 05:31:29,356 [DEBUG] No test for command 02deleteVersionDownloadScriptFile 2014-09-22 05:31:29,370 [INFO] Command 02deleteVersionDownloadScriptFile succeeded 2014-09-22 05:31:29,371 [DEBUG] Command 02deleteVersionDownloadScriptFile output: 2014-09-22 05:31:29,371 [DEBUG] No services specified 2014-09-22 05:31:29,384 [INFO] Running configSet Infra-EmbeddedPreBuild 2014-09-22 05:31:29,388 [INFO] Running configSet Hook-PreAppDeploy 2014-09-22 05:31:29,389 [INFO] Running config Hook-PreAppDeploy 2014-09-22 05:31:29,389 [DEBUG] No packages specified 2014-09-22 05:31:29,389 [DEBUG] No groups specified 2014-09-22 05:31:29,389 [DEBUG] No users specified 2014-09-22 05:31:29,390 [DEBUG] No sources specified 2014-09-22 05:31:29,390 [DEBUG] No files specified 2014-09-22 05:31:29,390 [DEBUG] Runni 54 [INFO]命令01downloadVersion成功2014-09-22 05:31:29,355 [DEBUG]命令01downloadVersion输出:2014-09-22 05:31:29,355 [DEBUG]运行命令02deleteVersionDownloadScriptFile 2014-09-22 05:31:29,356 [DEBUG]没有测试命令02deleteVersionDownloadScriptFile 2014-09-22 05:31:29,370 [INFO]命令02deleteVersionDownloadScriptFile成功2014-09-22 05:31:29,371 [DEBUG]命令02deleteVersionDownloadScriptFile输出:2014-09-22 05:31: 29,371 [DEBUG]未指定服务2014-09-22 05:31:29,384 [INFO]运行configSet Infra-EmbeddedPreBuild 2014-09-22 05:31:29,388 [INFO]运行configSet Hook-PreAppDeploy 2014-09-22 05: 31:29,389 [INFO]运行配置Hook-PreAppDeploy 2014-09-22 05:31:29,389 [DEBUG]没有指定包2014-09-22 05:31:29,389 [DEBUG]没有指定组2014-09-22 05: 31:29,389 [DEBUG]无用户指定2014-09-22 05:31:29,390 [DEBUG]未指定来源2014-09-22 05:31:29,390 [DEBUG]未指定文件2014-09-22 05:31: 29,390 [DEBUG] Runni ng command hooks 2014-09-22 05:31:29,390 [DEBUG] No test for command hooks 2014-09-22 05:31:41,367 [ERROR] Command hooks (directoryHooksExecutor.py --path /opt/elasticbeanstalk/hooks/appdeploy/pre/) failed 2014-09-22 05:31:41,367 [DEBUG] Command hooks output: 2014-09-22 05:31:41,368 [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-09-22 05:31:41,369 [ERROR] Unhandled exception during build: Command hooks failed Traceback (most recent call last ng命令挂钩2014-09-22 05:31:29,390 [DEBUG]没有测试命令挂钩2014-09-22 05:31:41,367 [ERROR]命令挂钩(directoryHooksExecutor.py --path / opt / elasticbeanstalk / hooks / appdeploy / pre /)失败2014-09-22 05:31:41,367 [DEBUG]命令挂钩输出:2014-09-22 05:31:41,368 [错误]构建Hook-PreAppDeploy时遇到错误:命令挂钩失败Traceback(最近一次调用last):文件“/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py”,第511行,在run_config CloudFormationCarpenter(config,self._auth_config).build(worklog)文件“/ usr在/ / / / / / / / / / / / / / / / / / / / / .6 / site-packages / cfnbootstrap / command_tool.py“,第113行,在apply raise ToolError(u”命令%s失败“%name)ToolError:命令挂钩失败2014-09-22 05:31:41,369 [ERROR]构建期间未处理的异常:命令挂钩失败Traceback(最近一次调用最后一次 ): File "/opt/aws/bin/cfn-init", line 122, in 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) ):文件“/ opt / aws / bin / cfn-init”,第122行,在worklog.build(detail.metadata,configSets)文件“/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py “,第117行,在构建承包商(元数据).build(configSets,self)文件”/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py“,第502行,在构建self.run_config(config ,worklog)文件“/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py”,第511行,在run_config中CloudFormationCarpenter(config,self._auth_config).build(worklog)文件“/ usr / lib / python2.6 / site-packages / cfnbootstrap / construction.py“,第247行,在构建中更改['commands'] = CommandTool()。apply(self._config.commands)文件”/usr/lib/python2.6/ site-packages / cfnbootstrap / command_tool.py“,第113行,在apply raise ToolError(u”命令%s失败“%name)

  2. This is another area that looked exceptionally bad. 这是另一个看起来特别糟糕的领域。 I have git installed and am not sure why it is asking about bundle... 我安装了git,不知道为什么要问关于捆绑...

    • bundle install Don't run Bundler as root. bundle install不要以root身份运行Bundler。 Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. 如果需要,Bundler可以请求sudo,并且以root身份安装捆绑包将破坏此计算机上所有非root用户的应用程序。 Fetching gem metadata from https://rubygems.org/ ........ You need to install git to be able to use gems from git repositories. https://rubygems.org/获取宝石元数据........您需要安装git才能使用git存储库中的gem。 For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git 有关安装git的帮助,请参阅https://help.github.com/articles/set-up-git上的GitHub教程

    2014-09-22 05:31:41,280 [ERROR] (4868 MainThread) [directoryHooksExecutor.py-33] [root directoryHooksExecutor error] Script /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed with returncode 11 2014-09-22 05:31:41,280 [ERROR](4868 MainThread)[directoryHooksExecutor.py-33] [根目录挂钩执行错误]脚本/opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh失败,返回码为11

I apologize for the code snippets being odd, I just can't win today! 我为代码片段奇怪而道歉,我今天无法获胜!

Does anyone have AWS/Elastic Beanstalk experience that can guide me in how to troubleshoot this? 有没有人有AWS / Elastic Beanstalk经验可以指导我如何解决这个问题?

Do you have git installed on your ec2 instance? 你的ec2实例上安装了git吗?

You can install it by using an ebextension. 您可以使用ebextension安装它。 Create a file called .ebextensions/01-git.config . 创建一个名为.ebextensions/01-git.config的文件。 The file name should have a .config extension. 文件名应具有.config扩展名。

The contents of the file can be as follows: 该文件的内容可以如下:

packages:
  yum:
    git: []

This file is in YAML format so indentation is important. 此文件采用YAML格式,因此缩进很重要。 You can read more about packages section of ebextensions here . 您可以在此处阅读有关ebextensions的包部分的更多信息 Commit this file and run git aws.push again. 提交此文件并再次运行git aws.push。 It will deploy a new application version to your environment and that will install git on your EC2 instances. 它将为您的环境部署一个新的应用程序版本,并将在您的EC2实例上安装git。

Most likely your Gemfile has sources as git urls. 很可能你的Gemfile有源代码作为git urls。 That is why bundler is trying to fetch using git. 这就是bundler尝试使用git获取的原因。 You can also consider using vendored gems with Elastic Beanstalk. 您还可以考虑使用带有Elastic Beanstalk的vendored gem。 Read more here . 在这里阅读更多。

Also regarding the python files, those are python scripts that Elastic Beanstalk runs to deploy the application version on your instances. 另外关于python文件,这些是Elastic Beanstalk运行的python脚本,用于在您的实例上部署应用程序版本。

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

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