I am new to using AWS, and have run into what appears to be a fairly common problem. I have created a deep learning app in Python which runs fine on Flask locally. However, when I create the app using AWS Elastic Beanstalk it builds fine. I am also able to run a simpler version of it on Heroku, but need to run the final app on AWS due to required resources.
However, when run the site fails to load and I get the following error page:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Checking the AWS error logs shows that the last few logs are:
[Fri Jan 03 20:05:13.255635 2020] [:error] [pid ~] /opt/python/run/venv/local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
[Fri Jan 03 20:05:13.255641 2020] [:error] [pid ~] _np_qint32 = np.dtype([("qint32", np.int32, 1)])
[Fri Jan 03 20:05:13.255672 2020] [:error] [pid ~] /opt/python/run/venv/local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
[Fri Jan 03 20:05:13.255677 2020] [:error] [pid ~] np_resource = np.dtype([("resource", np.ubyte, 1)])
[Fri Jan 03 20:06:15.487582 2020] [core:error] [pid ~] [client ~] Script timed out before returning headers: application.py
[Fri Jan 03 20:06:19.485185 2020] [core:error] [pid ~] [client ~] Script timed out before returning headers: application.py
[Fri Jan 03 20:06:23.489571 2020] [core:error] [pid ~] [client ~] Script timed out before returning headers: application.py
[Fri Jan 03 20:09:54.675100 2020] [core:error] [pid ~] [client ~] Script timed out before returning headers: application.py
[Fri Jan 03 20:10:18.094053 2020] [core:error] [pid ~] [client ~] End of script output before headers: application.py
[Fri Jan 03 20:10:18.094299 2020] [core:error] [pid ~] [client ~] End of script output before headers: application.py
From reading around I first thought that I have may have run into the same problem discussed here: AWS Elastic Beanstalk - Script timed out before returning headers: application.py
However, when I make the suggested addition to the wsgi.conf file I still find the same problem, even after rebuilding the environment. I'm not sure if I have made a mistake in implementation or if my problem is fundamentally different. If someone is able to shed some light on what may be the problem I would really appreciate it. I want to fix this issue and learn more about running code on these types of remote servers.
Please let me know if there are any details I have not provided which would be helpful. Thank you.