#Service to Service communication

17 messages · Page 1 of 1 (latest)

thin harness
#

Hey there,

I'm trying to establish a connection between two services.
Service A does a request to service B on it's internal DNS (http://xxx.railway.internal:8080). Where 8080 is the port defined via variables. Service B is up and running and health checks work.
However, In service A I'm getting a connection refused error. It's quite hard to debug afaik there's no solution to manually connect to the internal network via VPN or similar.
Thx for the help.

wispy nightBOT
#

Project ID: 8899878e-7b5e-4ce3-9b68-7dfaf37583b9

thin harness
#

Project ID: 8899878e-7b5e-4ce3-9b68-7dfaf37583b9

tepid gale
#

I'm not sure if it's related, but is service B broadcasting on IPv6? Railways internal networking only works if the recepient service uses IPv6

#

I'm not sure the port is necessary though, I think the .internal domain just ties to the PORT railway provides. I suppose you could try remove the port?

thin harness
#

Hey @tepid gale thx for the reply. So B can handle ipv6 requests on that endpoint. Not sure what boradcasting means in this context. not very experienced with ipv6 yet. I can try to remove the port (request 80)

tepid gale
#

depending on your language / server, it should be relatively simple to change it

thin harness
#

ah great. will try that, too. let's see.

#

@tepid gale hmm starting my server listening on :: instead of 0.0.0.0 the healthchecks are failing 😦 I guess they need ipv4?

#

I've to add that I'm deploying a docker container.

swift glacier
#

the healthcheck does indeed need your app to listen on ipv4, as does accessing the service publicly, and communicating via the private network requires your app to listen on ipv6, so your app must be capable of dual stack binding (ipv4 and ipv6)

what kind of app is this? my first guess would be fastapi and uvicorn, since I know uvicorn doesn't support dual stack binding natively

thin harness
#

Hey @swift glacier thx for your answer. Your guess is right. This is fastapi and uvicorn.

swift glacier
#

try hypercorn instead, it supports dual stack binding unlike uvicorn.
example start command

hypercorn main:app --bind [::]:$PORT
thin harness
#

Thx @swift glacier will try. It's a bit strange, though. Starting uvicorn with --host [::] I can locally curl with curl 0.0.0.0:8080 as well as curl '[::]:8080' in deployment it doesn't work.

swift glacier
#

docker is a whole different ball game, you can't come into this with the "if it works locally" mindset