Meteor can't start without "directConnection=true"

I always use a remote database when developing locally :sunglasses: So I tend to start meteor with these ENV’s:

MONGO_URL=mongodb://user:password@domain.com/app
MONGO_OPLOG_URL=........

I just began a new project, so I set up another MongoDB server (this time using Mongodb 5.0.7) and well my newest server kind of sucks.

The problem: Meteor fails to start when using a mongo URL like MONGO_URL=mongodb://user:password@domain.com:27017/app

MongoServerSelectionError: getaddrinfo ENOTFOUND blahblahblah

I have solved it by HOURS OF trial and error. Once I simply add directConnection=true then meteor will start. The url MUST be like so…

MONGO_URL=mongodb://user:password@domain.com:27017/app?directConnection=true
1 Like

That’s interesting, after a half hour of trying I gave up! I never got it to work and had figured it’s just how Meteor does local development envs. Thanks for sharing. Been wanting to be able to connect to remote Mongo boxes for a while now.

1 Like

Anyone have any more info on this issue?