简体   繁体   English

错误:在 AWS Beanstalk 上部署 web 应用程序时出现 ResolutionImpossible 错误

[英]ERROR: ResolutionImpossible error when deploying web application on AWS Beanstalk

Update:更新:

2022.05.08 I renamed the "requirement.txt" as "requirements.txt". 2022.05.08 我将“requirement.txt”重命名为“requirements.txt”。 But it cannot solve my problem.但它不能解决我的问题。 Now, new error information is现在,新的错误信息是

2022/05/08 03:30:45.608563 [INFO] ERROR: Cannot install -r requirements.txt (line 1), -r requirements.txt (line 7) and botocore==1.23.24 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Here is more information这里有更多信息

health cause:健康事业:

ELB processes are not healthy on all instances.
None of the instances are sending data.
ELB health is failing or not available for all instances.

first 10 lines(requirements file), this file was created by the command "pip freeze > requirements.txt"前 10 行(需求文件),该文件由命令“pip freeze > requirements.txt”创建

aiobotocore==2.1.1
aiohttp==3.8.1
aioitertools==0.10.0
aiosignal==1.2.0
async-timeout==4.0.2
attrs==21.4.0
boto3==1.21.10
botocore==1.23.24
certifi==2021.10.8
charset-normalizer==2.0.12

so, the packages that cannot be installed are: "aiobotocore", "botocore", and "boto3".因此,无法安装的软件包是:“aiobotocore”、“botocore”和“boto3”。

It seems so wired.看起来很连线。 "boto3" is a Python SDK for AWS, why it cannot be supported by AWS Elastic Beanstalk? “boto3”对于 AWS 来说是 Python SDK,为什么 AWS Elastic Beanstalk 不支持它?


I created a flask application to download files from S3.我创建了一个 flask 应用程序来从 S3 下载文件。 it worked well on my local PC, but I meet the 'Health: severe' problem when I tried to deploy my code on AWS Elastic Beanstalk.它在我的本地 PC 上运行良好,但当我尝试在 AWS Elastic Beanstalk 上部署我的代码时遇到“健康:严重”问题。

I checked the log and find this:我检查了日志并发现了这个:

May  8 01:28:48 ip-172-31-7-112 web: from flask import Flask, Response, render_template
May  8 01:28:48 ip-172-31-7-112 web: ModuleNotFoundError: No module named 'flask'
May  8 01:28:48 ip-172-31-7-112 web: [2022-05-08 01:28:48 +0000] [4977] [INFO] Worker exiting (pid: 4977)
May  8 01:28:48 ip-172-31-7-112 web: [2022-05-08 01:28:48 +0000] [4971] [INFO] Shutting down: Master
May  8 01:28:48 ip-172-31-7-112 web: [2022-05-08 01:28:48 +0000] [4971] [INFO] Reason: Worker failed to boot.
May  8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4985] [INFO] Starting gunicorn 20.1.0
May  8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4985] [INFO] Listening at: http://127.0.0.1:8000 (4985)
May  8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4985] [INFO] Using worker: gthread
May  8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4991] [INFO] Booting worker with pid: 4991
May  8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4991] [ERROR] Exception in worker process

I'm sure my application file is named as "application.py" and the application also is named as "application"我确定我的应用程序文件被命名为“application.py”并且应用程序也被命名为“application”

from flask import Flask, Response, render_template
from boto3 import client

application = Flask(__name__)

...

if __name__ == "__main__":
    application.run(debug=True)

I also checked the requirement.txt and find the flask information我也查看了requirement.txt,找到了flask的信息

Flask==2.0.3
flask==2.0.3 # at first I think it is an uppercase/lowercase issue, so I add the 'flask==2.0.3'

My python.config file:我的 python.config 文件:

option_settings:
  "aws:elasticbeanstalk:container:python":
    WSGIPath: application:application

I asked this question and now I solve it, so I want to share how I address this problem.我问了这个问题,现在我解决了,所以我想分享一下我是如何解决这个问题的。

First, I tried to fix this error by adjusting the package's version because the log provides more details about this issue like this:首先,我尝试通过调整包的版本来修复此错误,因为日志提供了有关此问题的更多详细信息,如下所示:

The conflict is caused by:
    The user requested botocore==1.25.9
    aiobotocore 2.3.1 depends on botocore<1.24.22 and >=1.24.21

However, it doesn't work.但是,它不起作用。 Each time I adjust the version, a new package dependency issue arises.每次调整版本都会出现新的package依赖问题。

So, I uninstalled all packages on Pycharm and install them one by one to make sure my application can run on my local PC.因此,我卸载了 Pycharm 上的所有软件包,并一一安装,以确保我的应用程序可以在我的本地 PC 上运行。 Next, I create a new 'requirements.txt' file by command接下来,我通过命令创建一个新的“requirements.txt”文件

pip freeze > requirements.txt

Then, I zip all the needed files and deploy my application on AWS.然后,我 zip 所有需要的文件并在 AWS 上部署我的应用程序。 It works.有用。 The health status is OK.健康状况还可以。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 AWS beanstalk 上部署多容器 docker 应用程序时如何防止错误“设备上没有剩余空间”? - how to prevent error "no space left on device" when deploying multi container docker application on AWS beanstalk? 将 Laravel 应用程序部署到 AWS Elastic Beanstalk 时出现“403 Forbidden”错误 - Getting a '403 Forbidden' error on deploying a Laravel application to AWS Elastic Beanstalk 将 web 应用程序部署到 Amazon elastic beanstalk 时出错 - Error while deploying web application to Amazon elastic beanstalk 将简单的 web 应用程序部署到 Elastic Beanstalk 时没有名为“应用程序”的模块出错 - No module named 'application' Error while deploying simple web app to Elastic Beanstalk 部署到 AWS elastic beanstalk 时,CSRF 验证失败并出现 403 错误 - CSRF verification failed with 403 error when deployed to AWS elastic beanstalk 在 AWS 上部署 Django 网站时出现 SQLite 错误 - SQLite error when deploying Django Website on AWS Django 'ModuleNotFoundError:部署到 Elastic Beanstalk 时没有名为'blog/wsgi' 的模块,以及'连接到上游时出错' - Django 'ModuleNotFoundError: No module named 'blog/wsgi' when deploying to Elastic Beanstalk, as well as 'Error while connecting to Upstream' springboot 版本升级 - 我在 aws elastic beanstalk 中部署时出现 sql 错误 - Springboot version upgrade - my sql error while deploying in aws elastic beanstalk AWS Elastic Beanstalk 中使用 PlaywrightCrawler 时出错 package - ERROR in AWS Elastic Beanstalk for using PlaywrightCrawler package AWS NodeJS 无服务器 - 部署项目时出现 Zip 错误 - AWS NodeJS Serverless - Zip Error When Deploying Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM