I'm trying to deploy my Flask web app using AWS EB (Amazon Web Services Elastic Beanstalk). Unfortunately, I'm running into the following error:
Your WSGIPath refers to a file that does not exist.
I've looked at the answers here and here; following the first suggestion didn't change anything (still received the same error). For reference, this fix involved creating an .ebextensions/ethanWebsite-env.config
file with the contents below, where ethanWebsite-env
is the name of my environment.
option_settings:
"aws:elasticbeanstalk:container:python":
WSGIPath: application.py
The second link suggests using the EB CLI command eb config
to modify the WSGIPath
environment variable. I've already done this using the AWS web GUI (the Software Configuration pane of the Configuration tab for my environment); it was already set to application.py
but I reset it to no avail. The error I get from attempting eb config
is perhaps more illuminating.
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
Similarly, if I specify the environment to configure with eb config ethanWebsite-env
, I receive the same error.
Here is the structure of my app.
ethan_website/
application.py
connect4.py
isPrime.py
requirements.txt
.ebextensions/
ethanWebsite-env.config
.elasticbeanstalk/
config.yml
static/
(various .css and .js files)
templates/
(various .html files)
I omitted a flask/
folder at the main project level, with lots of subfolders, which appears to configure the python environment and does not seem relevant.
If anyone has any insight into what could be the issue, please let me know. My error with eb config suggests to me that there is an issue with a config file, but I'm not sure where to start/look beyond the one I've already added. Thanks!