【问题标题】:Unable to deploy to AWS Elastic Beanstalk using Git无法使用 Git 部署到 AWS Elastic Beanstalk
【发布时间】:2014-07-24 06:51:26
【问题描述】:

我严格遵守 Elastic Beanstalk 文档 (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html),但无法使用 git 部署 node.js 或 PHP 应用程序。

$ eb push
Error: Failed to create the AWS Elastic Beanstalk application version
Cannot run aws.push for local repository HEAD: 

如果我尝试从 git 推送,也会发生同样的情况

$ git aws.push
Updating the AWS Elastic Beanstalk environment phpapp-env...
Error: Failed to create the AWS Elastic Beanstalk application version

当您调用 eb init 时,AWS 工具会设置一些 git 快捷方式。失败的调用是...

$.git/AWSDevTools/aws.elasticbeanstalk.createapplicationversion
Error: Failed to create the AWS Elastic Beanstalk application version

那个 python 模块的代码是...

from aws.dev_tools import *

if __name__ == "__main__":
  dev_tools = DevTools()
  dev_tools.create_application_version(None, None)

我已经为一个全新的 php 和 node.js 项目尝试过这个。我正在运行 Python 2.7.2、Ruby 2.1.2p95(2014-05-08 修订版 45877)[x86_64-darwin12.0]。有什么想法吗?

【问题讨论】:

    标签: php node.js git amazon-web-services amazon-elastic-beanstalk


    【解决方案1】:

    我们遇到了相同的错误消息,但原因不同。我们的 git commit 的提交消息太长或包含特殊字符。使用更简单的 git commit 消息将其清除。希望这对某人有帮助!

    【讨论】:

    • 谢谢你,你帮我省了几个小时的痛苦。永远不会想到这一点。
    • 当你git aws.push 时,BotoServer 似乎验证了一些东西,主要是提交消息长度。调试AWSDevTools 我得到了这个:Updating the AWS Elastic Beanstalk environment <BLABLA>... BotoServerError: 400 Bad Request {"Error":{"Code":"ValidationError","Message":"1 validation error detected: Value '<MSG LONGER THAN 200 CHARACTERS...>' at 'description' failed to satisfy constraint: Member must have length less than or equal to 200","Type":"Sender"},"RequestId":"352ae6c3-379b-11e4-834c-1b23c685d3ce"} Error: Failed to create the AWS Elastic Beanstalk application version
    • 有点相似,但我的 GIT 中有一个很长的标记用于之前的提交。将 v2.0 标记为最新提交并完成。它奏效了。
    【解决方案2】:

    这个错误只会影响使用多个 AWS 账户的人。似乎如果您在环境变量中声明了 AWS_CREDENTIAL_FILE,AWS 工具将选择它,而不是选择我为 Beanstalk 项目建立的本地凭证。您可以通过发出以下命令来检查正在使用的配置。

    git aws.config
    

    告诉我凭据来自...

    /Users/a12345/.ec2/CLI_Access_User.iam
    

    ...而不是本地环境。我希望错误消息表明这是一个权限问题。

    【讨论】:

      【解决方案3】:

      当我用完应用程序版本时发生这种情况,限制为 500

      【讨论】:

        【解决方案4】:

        我还有另一个可能导致此错误的原因,调试我得到了这个:

        {"Error":
            {"Code":"TooManyApplicationVersionsException",
             "Message":"You cannot have more than 500 Application Versions. Either remove some Application Versions or request a limit increase.",
             "Type":"Sender"},
        "RequestId":"xxxxxxxx-8184-11e4-xxxx-d5d8eef7a812"}
        

        绝对是 AWSDevTools,应该抛出比Error: Failed to create the AWS Elastic Beanstalk application version 提供更多信息的错误,甚至提供--verbose 选项。

        【讨论】:

          【解决方案5】:

          解决方案在这里: Amazon Elastick BeanStalk error: Failed to create the AWS Elastic Beanstalk application version

          上传到亚马逊的版本太多了。

          【讨论】:

            【解决方案6】:

            以上内容对某人有用,但如果您仍然发现问题,请检查您的 git aws.config,因为如果您正在使用多个帐户处理多个 Beanstalk,请尝试检查这是否正确。

            【讨论】:

              猜你喜欢
              • 2015-06-03
              • 2015-09-20
              • 2020-04-25
              • 2013-04-22
              • 2020-08-14
              • 2020-03-24
              • 2020-08-02
              • 2014-12-25
              • 2019-09-25
              相关资源
              最近更新 更多