OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Gunicorn App Isn't Working With GAE (static files work but the script doesn't work)

  • Thread starter Thread starter Lukas Dobbles
  • Start date Start date
L

Lukas Dobbles

Guest
The static files work fine but for some reason the entrypoint isn't running at all. I've even tried making running start.sh as an entrypoint with an echo "Starting gunicorn" and I don't see it in the logs. It's not my code I'm pretty sure since I've tested locally. This worked before when I didn't use gunicorn.

app.yaml:

Code:
runtime: python39
entrypoint: gunicorn --worker-class eventlet -t 4 -w 1 --timeout 120 main:app -b :$PORT

manual_scaling:
  instances: 1

network:
  session_affinity: true

handlers:
  # API handlers
  - url: /api/.*
    script: auto
    secure: always
    redirect_http_response_code: 301

  # Static file handlers
  - url: /(.*\.(html|css|js|png|jpg|jpeg|gif|ico|json|webp|svg))
    static_files: frontend/dist/\1
    upload: frontend/dist/(.*\.(html|css|js|png|jpg|jpeg|gif|ico|json|webp|svg))
    secure: always

  # Catch-all handler for other static files and single-page app support
  - url: /.*
    static_files: frontend/dist/index.html
    upload: frontend/dist/index.html
    secure: always

I was expecting the API/script and the static frontend to work but for some reason only the static files are working.
<p>The static files work fine but for some reason the entrypoint isn't running at all. I've even tried making running start.sh as an entrypoint with an echo "Starting gunicorn" and I don't see it in the logs. It's not my code I'm pretty sure since I've tested locally. This worked before when I didn't use gunicorn.</p>
<p>app.yaml:</p>
<pre><code>runtime: python39
entrypoint: gunicorn --worker-class eventlet -t 4 -w 1 --timeout 120 main:app -b :$PORT

manual_scaling:
instances: 1

network:
session_affinity: true

handlers:
# API handlers
- url: /api/.*
script: auto
secure: always
redirect_http_response_code: 301

# Static file handlers
- url: /(.*\.(html|css|js|png|jpg|jpeg|gif|ico|json|webp|svg))
static_files: frontend/dist/\1
upload: frontend/dist/(.*\.(html|css|js|png|jpg|jpeg|gif|ico|json|webp|svg))
secure: always

# Catch-all handler for other static files and single-page app support
- url: /.*
static_files: frontend/dist/index.html
upload: frontend/dist/index.html
secure: always
</code></pre>
<p>I was expecting the API/script and the static frontend to work but for some reason only the static files are working.</p>
 

Latest posts

Top