# Mongodb network access issues. IP Address?

**URL:** <https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143>\
**Category:** General\
**Created:** [24 March 2021 19:34 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143 "2021-03-24T19:34:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![perryjamessugden](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@perryjamessugden](https://discourse.nodered.org/u/perryjamessugden)\
**Post date:** [24 March 2021 19:34 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/1 "2021-03-24T19:34:33Z")

</div>

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,

 ![Web capture_24-3-2021_192541_cloud.mongodb.com](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/303bbbb40f3be5585769c1188b611dd2794dee90.jpeg)

 ![Web capture_24-3-2021_193313_127.0.0.1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9da2db535ab2e2f5168c1d40c13a35fd176d0a2.jpeg)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [24 March 2021 20:59 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/2 "2021-03-24T20:59:13Z")

</div>

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](https://docs.atlas.mongodb.com/security/ip-access-list/#add-ip-access-list-entries)

---

<div class="post-metadata">

**Author:** ![perryjamessugden](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@perryjamessugden](https://discourse.nodered.org/u/perryjamessugden)\
**Post date:** [24 March 2021 21:28 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/3 "2021-03-24T21:28:55Z")

</div>

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

 ![Web capture_24-3-2021_212414_127.0.0.1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2efa3bb06df2b8b65ead0e0ccc299e6ea51f3553.jpeg)

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [24 March 2021 21:36 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/4 "2021-03-24T21:36:34Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e54164cc184411fd154bf44521a19ccdfab9bca.png)

In Host use your : [cluster0.nvk6e.mongodb.net](http://cluster0.nvk6e.mongodb.net) not 127.0.0.1

---

<div class="post-metadata">

**Author:** ![perryjamessugden](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@perryjamessugden](https://discourse.nodered.org/u/perryjamessugden)\
**Post date:** [26 March 2021 09:13 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/5 "2021-03-26T09:13:38Z")

</div>

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](http://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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/3/5394108e03db4c4af24213fd879ad2ce919b3650.jpeg)  
 ![Screenshot 2021-03-26 090525](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d0c5acab52127548d9e29c26578acdd6faa3318d.png)

---

<div class="post-metadata">

**Author:** ![perryjamessugden](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@perryjamessugden](https://discourse.nodered.org/u/perryjamessugden)\
**Post date:** [26 March 2021 12:20 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/6 "2021-03-26T12:20:35Z")

</div>

![Web capture_26-3-2021_121924_127.0.0.1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/81c1df2ff08bc980a50d426691a19027d87f68f5.jpeg)

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [26 March 2021 13:55 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/7 "2021-03-26T13:55:10Z")

</div>

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](https://discourse.nodered.org/t/how-to-connect-mongodb-with-node-red/38620/15) 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 ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 May 2021 13:55 UTC](https://discourse.nodered.org/t/mongodb-network-access-issues-ip-address/43143/8 "2021-05-25T13:55:27Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
