Error message in web.stdout.log:
Oct 15 13:03:29 ip-172-31-18-218 web: ModuleNotFoundError: No module named 'application'
Oct 15 13:03:29 ip-172-31-18-218 web: [2020-10-15 13:03:29 +0000] [4633] [INFO] Worker exiting (pid: 4633)
Oct 15 13:03:29 ip-172-31-18-218 web: [2020-10-15 13:03:29 +0000] [4626] [INFO] Shutting down: Master
Oct 15 13:03:29 ip-172-31-18-218 web: [2020-10-15 13:03:29 +0000] [4626] [INFO] Reason: Worker failed to boot.
Error message in nginx/error.log
2020/10/15 13:04:21 [error] 4559#0: *19 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.42.151, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.18.218"
Flask app:
# EB looks for an 'application' callable by default.
application = Flask(__name__)
@application.route('/')
def home():
return "Hello World"
@application.route('/processImage')
def index():
[Some Code...]
if __name__ == '__main__':
# Setting debug to True enables debug output. This line should be
# removed before deploying a production app.
application.run('localhost',8000,debug=True)
requirements.txt
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
Flask==1.1.2
idna==2.10
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
numpy==1.19.2
opencv-python==4.4.0.44
requests==2.24.0
urllib3==1.25.10
Werkzeug==1.0.1
My folder structure:
eb-flask
|- .vscode (folder)
|- images (folder)
|- application.py
|- requirements.txt
Way of deployment:
Deployment via the Elastic Beanstalk Web UI by uploading a .zip archive of the above described folder.
Any ideas on how to further debug or solve this would be highly appreciated. Thanks a lot in advance.