Private networking connection refused

I have a web application connected to an API using private networking. I seem to be receiving an error when trying to fetch.
TypeError: fetch failed

at fetch (/app/node_modules/undici/index.js:112:13)

at processTicksAndRejections (node:internal/process/task_queues:95:5)

at action$8 (file:///app/build/server/index.js?t=1721893528000:8308:22)

at Object.callRouteAction (/app/node_modules/@remix-run/server-runtime/dist/data.js:37:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:88:20

at callLoaderOrAction (/app/node_modules/@remix-run/router/router.ts:4881:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:83:20

at async Promise.all (index 1)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:81:19

at callDataStrategyImpl (/app/node_modules/@remix-run/router/router.ts:4722:17) {

[cause]: Error: connect ECONNREFUSED fd12:8122:4304::7f:7611:cb72:8000

at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16) {

errno: -111,

code: 'ECONNREFUSED',

syscall: 'connect',

address: 'fd12:8122:4304::7f:7611:cb72',

port: 8000

}

}
TypeError: fetch failed

at fetch (/app/node_modules/undici/index.js:112:13)

at processTicksAndRejections (node:internal/process/task_queues:95:5)

at action$8 (file:///app/build/server/index.js?t=1721893528000:8308:22)

at Object.callRouteAction (/app/node_modules/@remix-run/server-runtime/dist/data.js:37:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:88:20

at callLoaderOrAction (/app/node_modules/@remix-run/router/router.ts:4881:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:83:20

at async Promise.all (index 1)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:81:19

at callDataStrategyImpl (/app/node_modules/@remix-run/router/router.ts:4722:17) {

[cause]: Error: connect ECONNREFUSED fd12:8122:4304::7f:7611:cb72:8000

at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16) {

errno: -111,

code: 'ECONNREFUSED',

syscall: 'connect',

address: 'fd12:8122:4304::7f:7611:cb72',

port: 8000

}

}
The API is listening on "[::1]:8000" and the URL passed to fetch looks good to me: http://my-api.railway.internal:8000/api/endpoint I didn't specify https per the docs.
Solution:
it needs to listen on [::]
Jump to solution
5 Replies
Percy
Percy4mo ago
Project ID: 7440ea60-c734-47cc-ba5d-e8cabf480488
volcanicislander
volcanicislanderOP4mo ago
7440ea60-c734-47cc-ba5d-e8cabf480488
Solution
Brody
Brody4mo ago
it needs to listen on [::]
volcanicislander
volcanicislanderOP4mo ago
You are correct sir, that resolved the issue. Thank you for the quick assistance.
Brody
Brody4mo ago
no problem!
Want results from more Discord servers?
Add your server