R
Railway14mo ago
terry

Trouble connecting to another service via private host

I set up a docker image which uses port 6333. The connection url they expect is http://host:6333. I set an environment variable PORT to 6333. I have a web app which tries to connect to the port but gets denied. If I expose the docker image via public url, it connects without a problem. Error initializing vector db TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11576:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async fetchJson (/app/node_modules/@qdrant/openapi-typescript-fetch/dist/cjs/fetcher.js:113:22) at async /app/node_modules/@qdrant/js-client-rest/dist/cjs/api-client.js:44:26 at async handler (/app/node_modules/@qdrant/openapi-typescript-fetch/dist/cjs/fetcher.js:134:16) at async /app/node_modules/@qdrant/js-client-rest/dist/cjs/api-client.js:30:24 at async handler (/app/node_modules/@qdrant/openapi-typescript-fetch/dist/cjs/fetcher.js:134:16) at async fetchUrl (/app/node_modules/@qdrant/openapi-typescript-fetch/dist/cjs/fetcher.js:140:22) at async Object.fun [as getCollections] (/app/node_modules/@qdrant/openapi-typescript-fetch/dist/cjs/fetcher.js:146:20) at async QdrantClient.getCollections (/app/node_modules/@qdrant/js-client-rest/dist/cjs/qdrant-client.js:780:26) { cause: Error: connect ECONNREFUSED fd12:cf8d:782e::c:a73d:5c5:6333 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: 'fd12:cf8d:782e::c:a73d:5c5', port: 6333 } Want to figure out what's the configuration to allow the connection?
Solution:
the private network is ipv6 only, so this docker service would need to be listening on all ipv6 addresses
Jump to solution
11 Replies
Percy
Percy14mo ago
Project ID: 9e9c5496-a3a5-4083-ac51-08f3c6805c97
terry
terryOP14mo ago
9e9c5496-a3a5-4083-ac51-08f3c6805c97 caring-ghost
Solution
Brody
Brody14mo ago
the private network is ipv6 only, so this docker service would need to be listening on all ipv6 addresses
terry
terryOP14mo ago
hey Brody, thanks for the answer. is there an example docker config that works for railway?
Brody
Brody14mo ago
nothing universal, it depends entirely on the app the docker image runs so what docker image are you trying to deploy
terry
terryOP14mo ago
managed to get it to work. made the image to listen to "::" as host, and used the service name without railway.internal as the connection url and it worked! somehow getaddrinfo fails when using railway.internal.
Brody
Brody14mo ago
still?
terry
terryOP14mo ago
it's working now with the service name only. i first tried to connect using the url with railway.internal and it gave me an error. wonder what the difference is. but happy it's working now tho.
Brody
Brody14mo ago
awsome! what docker image where you deploying though?
terry
terryOP14mo ago
qdrant/qdrant
Brody
Brody14mo ago
cool!
Want results from more Discord servers?
Add your server