【问题标题】:Can't deploy EB Django Application无法部署 EB Django 应用程序
【发布时间】:2021-10-18 23:23:01
【问题描述】:

这是我运行 eb deploy 后的完整错误:

Creating application version archive "app-210816_201313".
Uploading: [##################################################] 100% Done...
2021-08-17 01:13:46    INFO    Environment update is starting.
2021-08-17 01:13:51    INFO    Deploying new version to instance(s).
2021-08-17 01:14:06    ERROR   Your requirements.txt is invalid. Snapshot your logs for details.
2021-08-17 01:14:10    ERROR   [Instance: i-0995f885df1f382cb] Command failed on instance. Return code: 1 Output: (TRUNCATED)...)
  File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2021-08-17 01:14:10    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2021-08-17 01:14:10    ERROR   Unsuccessful command execution on instance id(s) 'i-0995f885df1f382cb'. Aborting the operation.
2021-08-17 01:14:10    ERROR   Failed to deploy application.

ERROR: ServiceError - Failed to deploy application.

这是我的 requirements.txt 文件:

asgiref==3.4.1
autopep8==1.5.7
awsebcli==3.20.1
backports.entry-points-selectable==1.1.0
botocore==1.21.22
cement==2.8.2
certifi==2021.5.30
charset-normalizer==2.0.4
colorama==0.4.3
distlib==0.3.2
Django==3.2.6
filelock==3.0.12
future==0.16.0
idna==3.2
jmespath==0.10.0
pathspec==0.5.9
pipenv==2021.5.29
platformdirs==2.2.0
pycodestyle==2.7.0
pypiwin32==223
python-dateutil==2.8.2
pytz==2021.1
pywin32==301
PyYAML==5.4.1
requests==2.26.0
semantic-version==2.8.5
six==1.14.0
sqlparse==0.4.1
termcolor==1.1.0
toml==0.10.2
urllib3==1.25.11
virtualenv==20.7.0
virtualenv-clone==0.5.6
wcwidth==0.1.9

我尝试了pip3 install -r requirements.txt,然后再次部署,但错误如上所示。我该如何解决?如何访问我的日志?提前致谢。我从头开始重新启动,但同样的错误。

【问题讨论】:

  • 您的需求中的某些库并不打算部署(virtualenv、virtualenv-clone、awsebcli、botocore、autopep8,...)。也许尝试为开发和生产创建单独的需求,然后再试一次?
  • @ÇağatayBarın 我怎么知道哪些不打算部署?

标签: python django amazon-web-services amazon-elastic-beanstalk


【解决方案1】:

好吧,我通过运行解决了这个问题

python -m pip freeze > requirements.txt 

在我的虚拟环境中,而不仅仅是我的项目目录。

但总体问题不是这个。我认为问题在于免费版本已贬值,无法处理我的新东西。

【讨论】:

    猜你喜欢
    • 2020-12-06
    • 2019-06-19
    • 2016-08-26
    • 2017-10-13
    • 2014-06-09
    • 2019-12-04
    • 2013-08-22
    • 1970-01-01
    • 2018-04-08
    相关资源
    最近更新 更多