After following freecampcode's web application tutorial, creating my own Google Cloud SDK project and deploying my sample social network website using Python and Flask (which I found mostly thought this tutorial), I am getting this same error: Internal/Unknown Server Error 500
, which looks like:
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.
Checking the logs, I get the errors:
-2020-07-06 01:51:29 default[20200705t214944] "GET / HTTP/1.1" 500
-2020-07-06 01:51:32 default[20200705t214944] "GET /favicon.ico HTTP/1.1" 500
Any help would be greatly appreciated. I've been stuck on this issue for a while. If you need additional information on the project, please let me know. This is my first gcloud project.
EDIT: I checked the error logs and saw the error:
ImportError: No module named main
at LoadObject (/base/alloc/tmpfs/dynamic_runtimes/python27g/174489198b39d9fb/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py:85)
at _LoadHandler (/base/alloc/tmpfs/dynamic_runtimes/python27g/174489198b39d9fb/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py:311)
at Handle (/base/alloc/tmpfs/dynamic_runtimes/python27g/174489198b39d9fb/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py:240)
So I added the file main.py with the contents:
from app.wsgi import main as app
entrypoint: gunicorn -b :$PORT app.wsgi:main
and I still get the same internal error.