MongoDB/Mongoose querySrv ENOTFOUND error with Express server
abstractmachina
PROOP

9 months ago

Hi, Im trying to spin up an old server that uses a plain old express server and mongoose. It worked fine last year (around june), however, this year im getting the following error:

Error: querySrv ENOTFOUND mongodb.tcp..mongodb.net
at QueryReqWrap.onresolve as oncomplete {
errno: undefined,
code: 'ENOTFOUND',
syscall: 'querySrv',
hostname: 'mongodb.tcp.cluster0.mlcgnn2.mongodb.net'
}

Googling it only gives me discussion on MongoDB Atlas and +srv connections, which railway doesn't seem to be using (as far as I understand). Did anyone encounter this error or knows what the problem is? I can't even figure out if its an issue with railway, express, mongoose or my DNS setting, so any pointers would be much appreciated.

Some more information:

  • Im using Node 16.20, mongoose 7.0.2, express 4.16

  • i can connect to the mongodb instance using mongoDB Compass and also a separate script that plainly connects to the db, just doesn't work when i start the server via nodemon.

Thanks in advance!

1 Replies

abstractmachina
PROOP

9 months ago

9285b073-c6a6-4d0f-bf1c-ca371f78d3bb


Loading...