HTTPX/requests cannot send REST requests to other service
I am trying to get API data from another service I have in the same project.
The code is not changed in a week and it suddenly stopped working today.
The service making the request is a Pycord bot towards FastAPI service
20 Replies
Project ID:
ff816097-dff3-4925-9c7d-c91d0c42ee5b
ff816097-dff3-4925-9c7d-c91d0c42ee5b
Also want to note, using public or private networking seems to not make a difference, I can access the public one via browser but not with the service
can you please define stopped working? that's extremely vague
Establishing connection with the httpx/requests to the service fails
The end of the log contains this message for httpx:
And this for requests:
Both services worked, as I printed the url and could see the docs
of FastAPI
can you please provide the url in question?
how do you know its listening on port 8000?
I use Railway's variables like this:
http://${{enigmacollective_backend.RAILWAY_PRIVATE_DOMAIN}}:${{enigmacollective_backend.PORT}}
that is definitely a good start, but doesn't quite answer my question
Are you refering to the settings of the service? In the logs of the deployment the internal port of FastAPI is 8000
but maybe the service settings got messed up?
are you aware that the private network is IPv6 only?
yes
you are listening on a IPv4 address
ah that's why
Solution
I need hypercorn
exactly
cool, thanks
hypercorn will dual stack bind when you use
::
i was experimenting with uvicorn so that's probably a leftover
big thanks Brody, you are my hero π
no problem!