Django Gunicorn Issue
apostolosvarvatis
HOBBYOP

5 months ago

Django ASGI app deploys successfully but is completely inaccessible - all URLs return "Application failed to respond"

Setup:

- Django 5.1.3 + DRF with ASGI (Gunicorn + Uvicorn workers)

- Pre-deploy: python manage.py migrate --noinput

- Start command: python manage.py collectstatic --noinput && gunicorn backend.asgi:application -k uvicorn.workers.UvicornWorker -w 2 --bind [::]:$PORT

What's Working:

- white_check_mark emoji App builds and deploys without errors

- white_check_mark emoji Gunicorn starts correctly on the assigned port (PORT is: 8080)

- white_check_mark emoji Workers boot successfully

- white_check_mark emoji No error logs or crashes

What's NOT Working:

- x emoji All HTTP requests return "Application failed to respond"

- x emoji No incoming request logs in Gunicorn (suggests requests aren't reaching the app)

- x emoji Service stops instantly and gives the following error:

Solved$10 Bounty

6 Replies

Railway
BOT

5 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


5 months ago

Looks like your container stopped.

Can you share what the metrics tab shows? Is it possible you're hitting an out of memory error?

Additionally it would be great if you could share the repository if it is open source.


samgordon

Looks like your container stopped.⠀Can you share what the metrics tab shows? Is it possible you're hitting an out of memory error?Additionally it would be great if you could share the repository if it is open source.

apostolosvarvatis
HOBBYOP

5 months ago

Sadly repository is not open source but i can share snippets if it helps.

Also metrics are these:
I dont think it is a metrics issue since the container instantly stops

Attachments


5 months ago

I am a bit curious if this is a ipv6 binding vs ipv4.

Can you change the bind command from :: to 0.0.0.0


apostolosvarvatis
HOBBYOP

5 months ago

This is resolved, the issue was actually a catch all route I had in Django, and the railway couldn't actually show anything on the server


Status changed to Solved brody 5 months ago


noahd

I am a bit curious if this is a ipv6 binding vs ipv4.Can you change the bind command from :: to 0.0.0.0

5 months ago

For future reference, Gunicorn will dual stack bind when binding to [::]


Status changed to Awaiting User Response Railway 5 months ago


Railway
BOT

5 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 5 months ago


Loading...