Mongodb network access issues. IP Address?

Hey

I've started to use Node-RED for a project which I'm super excited about.

I've setup my OSC in and formatted as JSON and can read in the debug window, all good.

Now i've been following some tutorials but run into an issue with using mongodb, to store JSON.

I can deploy with the correct monogodb inputs for DATABASE, HOST and PASSWORD setup with clusters.

But the mongodb in and out node status aren't changing from connecting, when I deploy.
Is the IP wrong? Could someone help me please.

see in images,

Thanks in advance

Hi Perry,

you are using MongoDb Atlas Cloud db ?
From the first screenshot, I see you used 127.0.0.1 in the IP Access list.
I believe there you should have used your public internet / external IP and not the 127.0.0.1 loopback
(google search 'what is my ip' from the device running node-red)
OR
if you want access for anyone 0.0.0.0 according to the docs

Hi UnborN

That's correct, i'm using MongoDb Atlas Cloud db Clusters.

Thanks I changed the IP to my address, but still having no luck.
Do you know whether the Mongodb node (Server - host & port) in Node-Red should be pointing elsewhere too?

please see image
thanks

What mongodb node are you using ? there are many
I recommend you use the node-red-node-mongodb 0.2.5 that has the appropriate settings for connecting to a cloud db (set to DNS cluster)

you may have to uninstall any other versions first to avoid any conflicts.

In Host use your : cluster0.nvk6e.mongodb.net not 127.0.0.1

1 Like

Hi UnborN

I removed all the other versions,
I'm now on 0.2.5

Setup network access on mongodb atlas again to my new IP address.

Tested with a mongodb node out and then in, within Node-red.

Naming host - cluster0.nvk6e.mongodb.net
Connect topology - DNS Cluster
my username and my password set correct.

It's throwing out in the debugger the error below, is this a issue you have encountered?

thanks

Web capture_26-3-2021_91010_127.0.0.1
Screenshot 2021-03-26 090525

You must have some settings wrong in the config.
I dont know what to recommend since most of my tests with mongodb were with the local version.
I havent tested the cloud version before but i followed a similar thread a while back regarding this.
You can read about it here and hopefully get some pointers.

From your last screenshot it seems to be related to "Authentication Failed" .. bad username password .. or not pointing to the correct Database ?

1 Like