第一个git服务器错误.推到弹性豆茎



我是Elastic Beanstalk的新手,正在尝试启动Rails 4应用程序。我遵循了这里的指南http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-reference-get-started.html,但是当我去做

git aws.push

它告诉我我的更新有错误。

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

ebs日志里塞满了许多我不熟悉的令人困惑的项目。很难说有什么好分享的,但这两个方面很突出

  1. 这里有很多No,所以这不是一个好兆头。还调用了一堆python文件,这是令人困惑的,因为我应该运行64位亚马逊Linux 2014.03 v1.0.4运行Ruby 2.0(乘客独立)。

    14-09-22 05:31:28,375 [INFO]正在运行configSet infri - writeapplication22014-09-22 05:31:28,376 [INFO]运行config infri - writeapplication22014-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_bundle2014-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设置模式为0007502014-09-22 05:31:28,625 [DEBUG]为/opt/elasticbeanstalk/bin/download_source_bundle设置owner 0和组02014-09-22 05:31:28,625 [DEBUG]运行命令01downloadVersion2014-09-22 05:31:28,626 [DEBUG]命令01downloadVersion没有测试2014-09-22 05:31:29,354 [INFO] Command 01downloadVersion succeeded .日志示例2014-09-22 05:31:29,355 [DEBUG]命令01downloadVersion输出:2014-09-22 05:31:29,355 [DEBUG]运行命令02deleteVersionDownloadScriptFile2014-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 infri - embeddedprebuild2014-09-22 05:31:29,388 [INFO]运行configSet Hook-PreAppDeploy2014-09-22 05:31:29,389 [INFO]运行config Hook-PreAppDeploy2014-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]运行命令钩子2014-09-22 05:31:29,390 [DEBUG]命令钩子没有测试2014-09-22 05:31:41 1367 [ERROR]命令钩子(directoryHooksExecutor.py——path/opt/elasticbeanstalk/hooks/appdeploy/pre/)失败2014-09-22 05:31:41 1367 [DEBUG]命令钩子输出:2014-09-22 05:31:41 1368 [ERROR]在构建Hook-PreAppDeploy时遇到错误:Command hooks失败回溯(最近一次调用):文件"/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py",第511行,在run_config .py中self._auth_config CloudFormationCarpenter(配置).build (worklog)文件"/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py",第247行,在buildchanges['commands'] = CommandTool().apply(self._config.commands)文件"/usr/lib/python2.6/site-packages/cfnbootstrap/command_tool.py",第113行,在apply抛出ToolError(u"Command %s failed" % name)ToolError:命令钩子失败2014-09-22 05:31:41,369 [ERROR]构建期间未处理的异常:命令钩子失败回溯(最近一次调用):文件"/opt/aws/bin/cfn-init",第122行worklog.build(细节。元数据,configSets)文件"/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py",第117行,在build承包商(元数据)。构建(configSets,自我)文件"/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py",第502行,在buildworklog self.run_config(配置)文件"/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py",第511行,在run_config .py中self._auth_config CloudFormationCarpenter(配置).build (worklog)文件"/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py",第247行,在buildchanges['commands'] = CommandTool().apply(self._config.commands)文件"/usr/lib/python2.6/site-packages/cfnbootstrap/command_tool.py",第113行,在applyraise ToolError(u"Command %s failed" % name)

  2. 这是另一个看起来特别糟糕的区域。我已经安装了git,不知道为什么它会询问bundle…

    • 包安装不要以root用户运行Bundler。如果需要,Bundler可以请求sudo以根用户身份安装bundle将会使所有非根用户的应用程序中断这台机器上的用户。从https://rubygems.org/........获取gem元数据你需要安装git才能使用git存储库中的gem。寻求帮助安装git,请参考GitHub的教程https://help.github.com/articles/set-up-git

    2014-09-22 05:31:41 1,280 [ERROR] (4868 MainThread) [directoryHooksExecutor.py-33] [root directoryHooksExecutor ERROR] Script/opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed with returncode 11

我为代码片段的奇怪道歉,我今天就是赢不了!

谁有AWS/Elastic Beanstalk的经验,可以指导我如何解决这个问题?

您的ec2实例上安装了git吗?

您可以使用ebeextension来安装它。创建名为.ebextensions/01-git.config的文件。文件的扩展名应该是.config

文件的内容可以如下所示:

packages:
yum:
git: []

这个文件是YAML格式的,所以缩进很重要。您可以在这里阅读更多关于ebeextensions的packages部分。提交该文件并运行git aws。推动了。它将在你的环境中部署一个新的应用程序版本,并在你的EC2实例上安装git。

很可能你的Gemfile有git url的来源。这就是为什么捆绑器试图使用git来获取。您还可以考虑在Elastic Beanstalk中使用供应商提供的gem。点击这里阅读更多内容。

同样关于python文件,这些是Elastic Beanstalk运行的python脚本,用于在实例上部署应用程序版本。

最新更新