开发者

Heroku could not authenticate mongolab

开发者 https://www.devze.com 2023-04-11 07:22 出处:网络
It was corrected two开发者_如何学JAVA days ago. And yesterday I committed some changes to heroku and the application crashed, I found from heroku logs that:

It was corrected two开发者_如何学JAVA days ago. And yesterday I committed 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 input the host/port/username/password/db name into mongoid.yml, still it could not get pass authentication.

I tried both database in Rackspace and in Amazon, but neither could authenticate.

Have you met with that before? Is there anything else I could check on Heroku besides heroku logs ?

Thanks.


Today I encountered the same on 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'

It's not because of this RUBY-890 bug, but because MongoLab upgraded to MongoDB 3.0 which uses SCRAM-SHA-1 challenge-response user authentication mechanism. So I needed latest ruby mongo driver version which is counting with this. In my case latest 1.x branch.

The minimum driver versions that support SCRAM-SHA-1 are:

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 have to be sure your credentils are ok :)


Make sure you're using the right username to connect to your database. The username you use to log into mongolab.com is different from the one attached to the 'uthenera' database. Have a look at the Users tab for that database at mongolab.com to see what database user(s) you've configured.

Hope that helps. Feel free to email support@mongolab.com if you need further assistance.

-Robert


You can get your database username and password using:

heroku config | grep MONGODB_URI

The response is in this format:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号