【问题标题】:AWS Elastic BeanStalk - Django Deployment failed (Error: chown /var/app/staging/env/bin/python: no such file or directory)AWS Elastic BeanStalk - Django 部署失败(错误:chown /var/app/staging/env/bin/python:没有这样的文件或目录)
【发布时间】:2022-06-11 00:22:37
【问题描述】:

我正在尝试将我的 django 应用程序部署到 AWS beanstalk,但出现以下错误

2022/03/05 08:06:43.401505 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_sourc
e_bundle -d /var/app/staging/
2022/03/05 08:06:45.020761 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging
/ successfully
2022/03/05 08:06:45.024804 [ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop run
ning the command. Error: chown /var/app/staging/env/bin/python: no such file or directory 

2022/03/05 08:06:45.024814 [INFO] Executing cleanup logic
2022/03/05 08:06:45.024928 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAI
LURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed. For de
tails, see 'eb-engine.log'.","timestamp":1646467605,"severity":"ERROR"}]}]}

我的配置文件如下

option_settings:
  aws:elasticbeanstalk:application:environment:
    DJANGO_SETTINGS_MODULE: "src.settings"
    PYTHONPATH: "/var/app/current:$PYTHONPATH"
  aws:elasticbeanstalk:container:python:
    WSGIPath: "src.wsgi:application"

有人可以告诉我我做错了什么吗? 请注意,我目前没有通过我的 django 设置在外部文件中使用任何环境变量

【问题讨论】:

    标签: django amazon-web-services django-rest-framework amazon-elastic-beanstalk


    【解决方案1】:

    我猜你在源包中部署了名为env 的虚拟环境,导致了冲突。您应该使用包含env/ 条目的.ebignore.gitignore 文件来排除您的虚拟环境目录。

    有关使用.ebignore.gitignore 的更多信息,请参阅https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html#python-flask-deployhttps://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html#eb-cli3-ebignore

    【讨论】:

      猜你喜欢
      • 2021-06-13
      • 2017-08-16
      • 1970-01-01
      • 2020-10-09
      • 2015-07-02
      • 2021-01-03
      • 1970-01-01
      • 2011-04-08
      • 2013-02-27
      相关资源
      最近更新 更多