Report this

What is the reason for this report?

The difference between MongoDB Instance set up on a "MongoDB" single-click app vs a "MEAN" single click app

Posted on June 14, 2015

Yesterday I ran into this problem: http://stackoverflow.com/questions/30822370/authentication-always-failing-when-connecting-to-mongodb

I was confident I did everything right, but alas, had no luck. The MongoDB instance I was using in this case was an instance of MongoDB set up from the single-click-install app for Ubuntu 14.04.

After having no luck, I decided to install the MeanStack single click application. It worked out of the box so I figured I could just dissect it, see what it was doing, and what I was doing wrong. To my surprise though, I couldn’t find what I was doing wrong at all in terms of how I had set up my database query. I just popped in my own app, completely replacing the MEAN app provided with my own, and it worked perfectly with that MongoDB instance.

So this leaves the instance of MongoDB as the only difference. Something about the MongoDB set up with the “MongoDB” app, meant a query that would work in the Mean Stack" app didn’t work there. Surely, I must have missed something I was supposed to do in the MongoDB app that prevented any of my authentication-related queries from working.

So what are the differences between the two instances of MongoDB which would cause one to work while the other didn’t? (In this case, the MEAN stack app allowed me to plugin and go straight away, while the MongoDB app didn’t…)



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @scalegrid:

Hi,

A few things

  1. bind_ip is only 127.0.0.1 - so you cannot connect to this instance from outside. You will need to comment out this line to access on other interfaces
  2. Can you comment out “noauth=true” and make sure “auth=true” is enabled to enable authentication
  3. if you using mongodb 3.0 please make sure you are using the mongo 3.0 client. There are changes in the authentication protocol that make the mongo 3.0 server incompatible with older version of mongo client.

Hope that helps, Dharshan

Founder Mongodirector.com

View the original comment

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.