Error api gateway calling services

I’ve had a few issues running my services on fly.io, given my api gateway is exposed and has HTTP setup, while my API gateway calls my services via TCP. Now it runs normally in the local environment, and even in the Docker environment, with minor tweaks in the API gateway env from

image

to

image

Yet when I try to run it on here with the Docker image, I deploy services first and get their URL, like this(example URL):

https://imaging-service.fly.dev

and change the environment from those two to this

image

In theory, it should be able to connect, but it did not, I’m not sure why ?

This is the fly.toml setup in the service

Now for the patient service dicom.internal, it’s not connected because i have not created it yet, but as for the other 2, I have created and use the host address, remove the https and add .internal in it, which now, when the service runs, it returns me the EConnectRefused issue with the address ?

I

My guess would be IPv6. This is one of the things that’s most different from running locally within Docker: the .internal network is IPv6-only, and hence it only works on [::]

https://fly.io/docs/networking/app-services/#get-the-service-listening-on-the-right-address-within-the-vm-2

With a Debian-based image, it can be checked via…

$ fly ssh console -a imaging-service
# apt-get update
# apt-get install --no-install-recommends iproute2
# ss -ltnp

The Local Address column should be * or [::] and not 0.0.0.0.

Hope this helps!


Aside: Your [[services]] block is (non-intuitively) silently doing nothing, assuming that that is the configuration file for imaging-service. You only need [[services]] for .flycast and .fly.dev.

As a general tip, it’s best to run fly config validate --strict before each deploy. This will warn about many confusing situations that flyctl does not actually mention otherwise.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.