【问题标题】:Elastic Beanstalk CLI Deploy zip errorElastic Beanstalk CLI 部署 zip 错误
【发布时间】:2015-09-18 21:40:10
【问题描述】:

当尝试在 osx Yosemite 和 python 3.4 上使用 awsebcli 进行部署时,我得到以下输出和错误:

Creating application version archive "app-150701_094953".
ERROR: ValueError :: ZIP does not support timestamps before 1980

似乎 zip 服务有问题,但我一直在四处寻找,到目前为止我还没有找到可行的解决方案。

编辑:

Retrieving logs...
(edify)7ddf32e17a6ac5:edify me$ eb deploy --debug 
2015-07-01 14:18:08,842 (DEBUG) eb : logging initialized for 'eb' using    
LoggingLogHandler
2015-07-01 14:18:08,842 (DEBUG) cement.ext.ext_plugin : plugin config  
dir /etc/eb/plugins.d does not exist.
2015-07-01 14:18:08,843 (DEBUG) cement.ext.ext_plugin : plugin config  
dir /Users/me/.eb/plugins.d does not exist.
2015-07-01 14:18:08,844 (DEBUG) eb : collecting arguments/commands for   
<ebcli.core.base.EbBaseController object at 0x10bfdc908>
2015-07-01 14:18:08,848 (DEBUG) eb : collecting arguments/commands for  
<ebcli.controllers.deploy.DeployController object at 0x10bfea3c8>
-- EBCLI Version: 3.4.5
-- Python Version: 3.4.3 (default, Feb 25 2015, 21:28:45) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]
2015-07-01 14:18:08,854 (DEBUG) ebcli.core.fileoperations : Project   
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,869 (DEBUG) ebcli.objects.sourcecontrol : Git    
Version: git version 2.1.3.36.g8e36a6d
2015-07-01 14:18:08,878 (DEBUG) ebcli.objects.sourcecontrol : git  
symbolic-ref result: refs/heads/master
2015-07-01 14:18:08,879 (DEBUG) ebcli.core.fileoperations : Project   
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,882 (DEBUG) ebcli.core.fileoperations : Project   
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,885 (DEBUG) ebcli.core.fileoperations : Project  
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,892 (DEBUG) ebcli.objects.sourcecontrol : Git   
Version: git version 2.1.3.36.g8e36a6d
2015-07-01 14:18:08,896 (DEBUG) ebcli.objects.sourcecontrol : git   
symbolic-ref result: refs/heads/master
2015-07-01 14:18:08,897 (DEBUG) ebcli.core.fileoperations : Project   
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,900 (DEBUG) ebcli.core.fileoperations : Project   
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,902 (DEBUG) ebcli.core.fileoperations : Project    
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,905 (DEBUG) ebcli.core.fileoperations : Project   
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,907 (DEBUG) ebcli.core.fileoperations : Project 
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,914 (DEBUG) ebcli.objects.sourcecontrol : Git   
Version: git version 2.1.3.36.g8e36a6d
2015-07-01 14:18:08,918 (DEBUG) ebcli.objects.sourcecontrol : git    
symbolic-ref result: refs/heads/master
2015-07-01 14:18:08,918 (DEBUG) ebcli.core.fileoperations : Project    
root found at: /Users/me/PycharmProjects/edify
2015-07-01 14:18:08,921 (ERROR) eb : This branch does not have a   
default environment. You must either specify an environment by typing   
"deploy my-env-name" or set a default environment by typing "eb use my- 
env-name".

【问题讨论】:

  • 嘿!您能否添加更多详细信息,例如您使用的确切 CLI 命令等?
  • 您可以使用 --debug 选项运行,这将为您提供堆栈跟踪和(可能)更多信息。
  • 感谢调试标志建议,它为我提供了修复命令所需的内容。所以我使用了eb deploy ,但没有默认配置文件或区域设置,所以它失败了。邮编错误真的让我迷失了方向。关于为什么会出现的任何想法?

标签: python-3.x amazon-web-services zip command-line-interface amazon-elastic-beanstalk


【解决方案1】:

您可以运行eb deploy -v 来验证错误的确切来源。对我来说,我在尝试将 express 应用程序部署到弹性 beanstalk 时遇到了这个错误。通过运行上面的命令,我发现错误是因为 uglify-js 的错误版本,其中包含带有 1969 年时间戳的文件。只需将 uglify js 从 v2.8.28 降级到 v2.8.27,它没有修复 1969 年的时间戳对我来说问题。你读过这个问题here

【讨论】:

  • eb deploy -v 为我节省了一天,它锁定了罪魁祸首
【解决方案2】:

您可能忘记提交项目(不要忘记 ebcli 运行基于 git 存储库的项目!)

【讨论】:

  • 好的,谢谢。问题实际上是我的 eb 个人资料上没有所需的信息。不过奇怪的错误。
【解决方案3】:

我找到了解决方案here

添加到您的 package.json 脚本中:

"scripts": {
    "install": "find ./node_modules/* -mtime +10950 -exec touch {} \\;"
}

【讨论】:

    【解决方案4】:

    我认为您可以通过将部署脚本传递给 --staged 标志来代替使用本地文件,因为您至少已经暂存了您的更改。

    【讨论】:

      【解决方案5】:

      通常是因为您不必要地将 node_modules 文件夹部署到弹性 beanstalk。那里有大量文件,其中一个很可能是罪魁祸首。但是 EB 在执行 npm install 命令时会创建自己的 node_modules 文件夹...

      因此,如果这适用于您,解决方法是将 node_modules 添加到您的 .ebignore 文件中。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-11-10
        • 2016-03-04
        • 2019-02-22
        • 2021-08-28
        • 2017-10-04
        • 2014-12-16
        • 2020-04-25
        • 2021-12-07
        相关资源
        最近更新 更多