7 months ago
Hello,
I have 3 services on my project, mongodb + frontend + backend ; i could configure private networking between database and backend successfully, but i can't get it done between frontend and backend (frontend wont deploy).
What I did :
- read the doc about private networking
- configured the backend to listen to ipv6
- configured the right environment variable on frontend to be "http://sg-backend.railway.internal:3001/graphql"
- ensured that the port is correct
- ensured that the backend service is running and available on public networking in my browser
- configured CORS on the backend to accept from "http://sg-frontend.railway.internal"
I keep having this error in the deployment logs:
#10 45.44 Failed to load schema from http://sg-backend.railway.internal:3001/graphql:
#10 45.44 getaddrinfo ENOTFOUND sg-backend.railway.internal
#10 45.44 Error: getaddrinfo ENOTFOUND sg-backend.railway.internal
I would appreciate any insight onto what to double check or look for next, I can provide more info if needed. I am new to this help section and to railway.
3 Replies
7 months ago
I'm using NUXT that REQUIRES accessing the backend to load the graphql schema DURING the build process. So this is my thinking :
There is no "sleep 4 &&" or "?connect_timeout=30" strategy for me that I'll work, I have to load the schema from the public network and THEN switch to private networking when i launch requests, which has to be done programmatically. That might be possible as i'm aware of.
Thank you for your time
7 months ago
Yes that's what you'd need to do, public network during build and private during runtime.