Geroku could not authenticate Mongolab

This was fixed two days ago. And yesterday I made some changes to heroku, and the application crashed, I found from heroku logs that:

 /app/.bundle/gems/ruby/1.9.1/gems/mongo-1.4.0/lib/mongo/db.rb:137:in `issue_authentication': Failed to authenticate user 'larryzhao' on db 'uthenera' (Mongo::AuthenticationError) 

I even explicitly entered the hostname / port / username / password / db in the mongoid.yml file, but could not get authentication on the pass.

I tried both databases in Rackspace and in Amazon, but could not authenticate.

Have you met this before? Is there anything else I could check on Heroku other than heroku logs ?

Thanks.

+4
source share
3 answers

Make sure you use the correct username to connect to the database. The username you use to log in to mongolab.com is different than the username associated with the "uthenera" database. See the Users tab for this database at mongolab.com to see which database users you have configured.

Hope this helps. Feel free to contact support@mongolab.com if you need further assistance.

-Robert

+3
source

Today I came across the same thing in Heroku:

 Mongo::AuthenticationError: Failed to authenticate user 'heroku_app111' on db 'heroku_app111'. from /home/ad/.rvm/gems/ ruby-2.1.3@app /gems/mongo-1.11.1/lib/mongo/functional/authentication.rb:205:in `issue_authentication' 

This is not due to this RUBY-890 error , but because MongoLab has been upgraded to MongoDB 3.0, which uses the SCRAM-SHA-1 request-response authentication mechanism. So I need the latest version of rubi mongo that counts with this. In my case, the last branch is 1.x.

The minimum drivers that support SCRAM-SHA-1 are as follows:

 Driver Language Version C 1.1.0 C++ 1.0.0 C# 1.10 Java 2.13 Node.js 1.4.29 Perl 0.708.0.0 PHP 1.6 Python 2.8 Motor 0.4 Ruby 1.12 Scala 2.8.0 

Of course, you must be sure that your credentils are fine :)

+3
source

You can get the username and password of your database using:

heroku config | grep MONGODB_URI

The answer is in this format:

MONGOLAB_URI: mongodb://username: password@mlab.com :12345/db

0
source

All Articles