django - eb 部署错误 - chown/var/app/staging/venv/bin/python : no such file or directory

标签 django amazon-web-services deployment

遵循 AWS 说明 ( https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html )

当前正在尝试运行“eb deploy”并输出以下内容:

    Creating application version archive "app-220413_141345835306".
Uploading: [##################################################] 100% Done...
2022-04-13 20:14:00    INFO    Environment update is starting.      
2022-04-13 20:14:05    INFO    Deploying new version to instance(s).
2022-04-13 20:14:09    ERROR   Instance deployment failed. For details, see 'eb-engine.log'.
2022-04-13 20:14:11    ERROR   [Instance: i-0fb1ab203cc59f0d1] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error..
2022-04-13 20:14:11    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2022-04-13 20:14:11    ERROR   Unsuccessful command execution on instance id(s) 'i-0fb1ab203cc59f0d1'. Aborting the operation.
2022-04-13 20:14:11    ERROR   Failed to deploy application.        
                                                                      
ERROR: ServiceError - Failed to deploy application.

在日志中我看到:

2022/04/13 20:00:19.230141 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2022/04/13 20:00:19.231105 [ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Erro
r: chown /var/app/staging/venv/bin/python: no such file or directory 

有什么想法要做什么吗?我不知道这条路从哪里来

最佳答案

这里的第二个答案对我有用:AWS Elastic Beanstalk chown PythonPath error

我在我的主项目目录中添加了一个名为 .ebignore 的文件:

~/ebdjango/
|-- .ebignore
|-- .ebextensions
|   `-- django.config
|-- ebdjango
|   |-- __init__.py
|   |-- settings.py
|   |-- urls.py
|   `-- wsgi.py
|-- db.sqlite3
|-- manage.py
`-- requirements.txt

文件内容只有一行:

venv

关于django - eb 部署错误 - chown/var/app/staging/venv/bin/python : no such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71863456/

相关文章:

python - 如何判断我的 Django 应用程序是否在开发服务器上运行?

python - DJANGO 中一页包含多个表单

security - 可以与 AWS 中的安全组关联的所有资源有哪些?

node.js - 使用 pm2 启动 sails 应用程序时出错

asp.net - 应用程序 'D:\home\site\wwwroot\' 在检测到 app_offline.htm 后被回收 - ASP.NET

java - 查找单个方法调用所依赖的所有类/Arquillian Micro Deployments : How to collect necessary classes autmatically?

django - 在本地运行结构脚本

Django-rest-framework json 转储

angular - AWS amplify Angular 自定义验证器组件

python - 从 numpy、pandas 等大型模块中自动删除未使用的代码