Uvicorn Health Check Fails with IPv6 Bind
Getting really confused, I switched from Hypercorn to Uvicorn for alleged performance reasons, and while it binds just find to IPv6 and IPv4 locally, as well as IPv4 on Railway (the healthcheck succeeds), IPv6 just refuses to be bound.
Solution:Jump to solution
went back to look at what i had previously tested, i used gunicorn with a uvicorn worker -
...
13 Replies
Project ID:
daea8913-00d4-474d-b3d8-2bfc2bfbbcf0
daea8913-00d4-474d-b3d8-2bfc2bfbbcf0
Yeah, the double JSON logging is weird, but I have different problems right now.
The app binds fine to IPv6, it just won't clear the healthcheck. Although, I don't think Caddy resolved either... :/
The latest project deploy is bound to
0.0.0.0
and it works fine; but of course we need Private Networking (which worked wonderfully with Hypercorn).
We use the Caddy proxy over Private Networking, which as we know does not support IPv4 networking.
With hypercorn, we invoked it via
Now we do and uvicorn.run
is invoked internally.Yeah, confirmed, the IPv6 bind will run fine, but neither the healthcheck or Caddy instance can connect to it. Testing locally, doesn't seem like anything should be going wrong.
Okay, I restored a temporary hotfix that uses hypercorn like this: And it does work just fine.
I dunno, I guess I'm kinda shooting myself in the foot here by admitting that, because I doubt Railway staff are particularly interested in figuring out why one of two available compatible ASGI workers are just not working.
I've had uvicorn binding to IPv6 working with health checks when I did my test suite for the new runtime
Any details about what might differ between our setups?
not this moment, I'd have to re-roll a python app with uvicorn and what happens
Really not looking good, I tried using the uvicorn variant:
uvicorn \"linkpulse.app:app\" --host :: --port $PORT
, but no dice. Healthcheck still fails, Caddy doesn't connect.I'll check it out when I'm back at my computer later
Solution
went back to look at what i had previously tested, i used gunicorn with a uvicorn worker -