MongoNetworkError: getaddrinfo ENOTFOUND mongo.railway.internal
simoelalj
HOBBYOP

2 years ago

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?

17 Replies


brody
EMPLOYEE

2 years ago

3 seconds is required, not 100ms


simoelalj
HOBBYOP

2 years ago

Okay, thanks. I'm making the changes and monitoring I would get the error again.


simoelalj
HOBBYOP

2 years ago

I just added the delay, and still getting the ENOTFOUND error

1242132655005372400


brody
EMPLOYEE

2 years ago

nixpacks or Dockerfile?


simoelalj
HOBBYOP

2 years ago

Dockerfile


simoelalj
HOBBYOP

2 years ago

it might be due to alpine3.18


brody
EMPLOYEE

2 years ago

you are correct, could be a few combined things too


brody
EMPLOYEE

2 years ago

do you know where to find the alpine variable to fix this?


simoelalj
HOBBYOP

2 years ago

ENABLE_ALPINE_PRIVATE_NETWORKING=true ?


brody
EMPLOYEE

2 years ago

correct


brody
EMPLOYEE

2 years ago

are you also using ioredis?


simoelalj
HOBBYOP

2 years ago

Yes, I'm initilizing using family: 0


brody
EMPLOYEE

2 years ago

perfect


simoelalj
HOBBYOP

2 years ago

If I switch node-alpine with the node-slim would that solve most of the networking problems?


brody
EMPLOYEE

2 years ago

yes you can do that or set the service variable you mentioned, whatever works best for you


simoelalj
HOBBYOP

2 years ago

Okay it seems to be fixed, thanks. We can close this


Loading...