MongoNetworkError: getaddrinfo ENOTFOUND mongo.railway.internal

I'm getting random errors from my NodeJS express app. I have added the 100ms before connecting to mongo on the start. The app connects successfully, and can query the Mongo database, but randomly I get an getaddrinfo ENOTFOUND error, which makes my app unstable. Any idea about what might be happening?
Solution:
ENABLE_ALPINE_PRIVATE_NETWORKING=true ?
Jump to solution
14 Replies
Percy
Percy7mo ago
Project ID: 3b13cbe2-3b70-48df-8799-b43f302ae6bc
simoelalj
simoelaljOP7mo ago
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Brody
Brody7mo ago
3 seconds is required, not 100ms
simoelalj
simoelaljOP7mo ago
Okay, thanks. I'm making the changes and monitoring I would get the error again. I just added the delay, and still getting the ENOTFOUND error
Brody
Brody7mo ago
nixpacks or Dockerfile?
simoelalj
simoelaljOP7mo ago
Dockerfile it might be due to alpine3.18
Brody
Brody7mo ago
you are correct, could be a few combined things too do you know where to find the alpine variable to fix this?
Solution
simoelalj
simoelalj7mo ago
ENABLE_ALPINE_PRIVATE_NETWORKING=true ?
Brody
Brody7mo ago
correct are you also using ioredis?
simoelalj
simoelaljOP7mo ago
Yes, I'm initilizing using family: 0
Brody
Brody7mo ago
perfect
simoelalj
simoelaljOP7mo ago
If I switch node-alpine with the node-slim would that solve most of the networking problems?
Brody
Brody7mo ago
yes you can do that or set the service variable you mentioned, whatever works best for you
simoelalj
simoelaljOP7mo ago
Okay it seems to be fixed, thanks. We can close this
Want results from more Discord servers?
Add your server