Hello, I have a project set up on Google Cloud App Engine Standard and I am having a problem that I can't get to the root of. I have a Flask web app and when I deploy it and access the website, it always returns a 404.
I have tested the deployment locally and it works fine. The logs show no error and I don't know what to do.
This is my app.yaml:
runtime: python39
entrypoint: gunicorn -b :$PORT -w 2 main:app
error_handlers:
- file: error.html
handlers:
# This configures Google App Engine to serve the files in the app's static
# directory.
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /static
static_dir: static
# This handler routes all requests not caught above to your main app. It is
# required when static routes are defined, but can be omitted (along with
# the entire handlers section) when there are no static files defined.
- url: /.*
script: auto
When I run "gcloud app logs tail -s default" and access the link, I get these logs:
2024-02-02 01:40:44 default[20240127t133812] "GET / HTTP/1.1" 200
2024-02-02 01:40:44 default[20240127t133812] [2024-02-02 01:40:44 +0000] [11] [INFO] Starting gunicorn 21.2.0
2024-02-02 01:40:44 default[20240127t133812] [2024-02-02 01:40:44 +0000] [11] [INFO] Listening at: http://0.0.0.0:8081 (11)
2024-02-02 01:40:44 default[20240127t133812] [2024-02-02 01:40:44 +0000] [11] [INFO] Using worker: gthread
2024-02-02 01:40:44 default[20240127t133812] [2024-02-02 01:40:44 +0000] [18] [INFO] Booting worker with pid: 18
2024-02-02 01:40:44 default[20240127t133812] [2024-02-02 01:40:44 +0000] [21] [INFO] Booting worker with pid: 21
2024-02-02 01:40:44 default[20240127t133812] [2024-02-02 01:40:44 +0000] [22] [INFO] Booting worker with pid: 22
2024-02-02 01:40:44 default[20240127t133812] [2024-02-02 01:40:44 +0000] [23] [INFO] Booting worker with pid: 23
2024-02-02 01:40:45 default[20240127t133812] "GET /static/style.css HTTP/1.1" 200
2024-02-02 01:40:45 default[20240127t133812] "GET /static/script.js HTTP/1.1" 200
2024-02-02 01:40:45 default[20240127t133812] "GET /favicon.ico HTTP/1.1" 404
2024-02-02 01:42:03 default[20240127t133812] "GET / HTTP/1.1" 200
I don't have /static/style.css or /static/script.js in my directory. They're named static/main.css and static/main.js
I'm not sure why I'm getting this error and would appreciate any help.