3 months ago
I'm trying to connect from my Astro application to my Next server via the internal network through network variables, but I keep getting
Failed to parse URL from kingdom-events.railway.internal/api/attendees
ERR_INVALID_URL
Is there anything I'm missing?
6 Replies
3 months ago
This is how I have specified my ENV variable
${{kingdom-events.RAILWAY_PRIVATE_DOMAIN}}/api
3 months ago
Heya, it seems you're just missing the https://
in your env var. You could make it work like so: https://${{kingdom-events.RAILWAY_PRIVATE_DOMAIN}}/api
. RAILWAY_PRIVATE_DOMAIN
only gives you the domain w/o any protocol (so not a URL).
hope this helps !
Best,
Nico
Status changed to Awaiting User Response railway[bot] • 3 months ago
itsrems
Heya, it seems you're just missing the https:// in your env var. You could make it work like so: https://${{kingdom-events.RAILWAY_PRIVATE_DOMAIN}}/api . RAILWAY_PRIVATE_DOMAIN only gives you the domain w/o any protocol (so not a URL).hope this helps !Best,Nico
3 months ago
Makes sense. But when I changed it to https://${{kingdom-events.RAILWAY_PRIVATE_DOMAIN}}/api
I get
cause: Error: connect ECONNREFUSED fd12:[redacted]:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: 'fd12:[redacted]:ffd6',
port: 443
Status changed to Awaiting Railway Response railway[bot] • 3 months ago
davehowson
Makes sense. But when I changed it to https://${{kingdom-events.RAILWAY_PRIVATE_DOMAIN}}/apiI getcause: Error: connect ECONNREFUSED fd12:[redacted]:443Jan 28 09:12:41at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)Jan 28 09:12:41at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17) {Jan 28 09:12:41errno: -111,Jan 28 09:12:41code: 'ECONNREFUSED',Jan 28 09:12:41syscall: 'connect',Jan 28 09:12:41address: 'fd12:[redacted]:ffd6',Jan 28 09:12:41port: 443
3 months ago
I changed my next projects start script to this following docs as well
next start --hostname :: --port ${PORT-3000}"
But still getting connection refused
davehowson
I changed my next projects start script to this following docs as wellnext start --hostname :: --port ${PORT-3000}"But still getting connection refused
3 months ago
Not sure if I should specify the port in my FE, but I did sohttps://${{kingdom-events.RAILWAY_PRIVATE_DOMAIN}}:8080/api
and now I get
cause: [Error: 40EC5784F77F0000:error:0A0000C6:SSL routines:tls_get_more_records:packet length too long:ssl/record/methods/tls_common.c:662:
] {
library: 'SSL routines',
reason: 'packet length too long',
code: 'ERR_SSL_PACKET_LENGTH_TOO_LONG'
}
3 months ago
Removed https and it works
http://${{kingdom-events.RAILWAY_PRIVATE_DOMAIN}}:8080/api
- is the right way. Thank you
Status changed to Solved brody • 3 months ago