Fastapi ipv6 not reachable

andrea-twiniPRO

10 months ago

I have a couple fastapi based services (dashboard and chatbot) run with the following command:

'uvicorn chatbot.app:make_app --host 0.0.0.0 --port $PORT --factory --no-server-header'

I need to reach over private network from chatbot to dashboard.

Using '0.0.0.0' as host I cannot reach them (target is unreachable). I do use alpine based images.

I've tried to use '::' to enable ipv6 but then railway cannot reach my service to respond to http requests.

Any ideas on how I could fix this?

Solved

3 Replies

9 months ago

Uvicorn doesn't support dual stack binding, I would recommend you use hypercorn instead.


andrea-twiniPRO

9 months ago

Thanks for your reply. I suggest you to update your doc accordingly if dual stack binding is needed to enable both private and public network reachability fir python apps.


9 months ago

Good callout, we will do that!


Status changed to Solved brody 9 months ago