1
votes

I am hosting a meteor application at galaxy.meteor.com and was planning to use a mongolab.com (mlab.com) database with this app, as recommended by the galaxy developers. Unfortunately, I cannot connect my application to the mlab database. The following is my settings.json file:

{   "galaxy.meteor.com": { 
          "env": { 
            "ROOT_URL": "http://<appname>.meteorapp.com/", 
            "MONGO_URL": "mongodb://<dbuser>:<dbpassword>@ds<123456>-a0.mlab.com:<123456>,<ds123456>-a1.mlab.com:<123456>/<dbname>?replicaSet=rs-ds<123456>",
            "MONGO_OPLOG_URL": "mongodb://<oplog-reader-name>:<oploguserpassword>@ds<123456>-a0.mlab.com:<123456>,ds<123456>-a1.mlab.com:<123456>/admin?replicaSet=rs-ds<123456>"
          }     
}}

The Meteor logs show the following problem:

2xkx 2016-03-20 22:37:50+01:00 Exception in callback of async function: MongoError: auth failed 2xkx 2016-03-20 22:37:50+01:00 at Object.toError (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/utils.js:110:11) 2xkx 2016-03-20 22:37:50+01:00 at /app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1128:31 2xkx 2016-03-20 22:37:50+01:00 at /app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1843:9 2xkx 2016-03-20 22:37:50+01:00 at Server.Base._callHandler (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/base.js:445:41) 2xkx 2016-03-20 22:37:50+01:00 at /app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:468:18 2xkx 2016-03-20 22:37:50+01:00 at [object Object].MongoReply.parseBody (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5) 2xkx 2016-03-20 22:37:50+01:00 at [object Object]. (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:426:20) 2xkx 2016-03-20 22:37:50+01:00 at [object Object].emit (events.js:95:17) 2xkx 2016-03-20 22:37:50+01:00 at [object Object]. (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13) 2xkx 2016-03-20 22:37:50+01:00 at [object Object].emit (events.js:98:17)

The mongodb-logs display the error as follows.

Failed to authenticate dbusername@dbname with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document

Any suggestions? Thanks

2
You have lots of <> in there. Usually we use these in documentation to specify the elements and "variables" that need to be replaced in a string. Especially since you have them all over your port assignments, have you actually left those in your URI strings? If so then they are not meant to be there, so strip them out. - Blakes Seven
There are no '<>' in the actual URI's I'm using. I did of course replace them with my actual db name, ... - miwe
I'm having the same issue connecting even from my local meteor instance. I'm getting MongoError: Authentication Failed in oplog_tailing.js. Hopefully someone replies here with an answer. - Shane Reustle
According to my mlab mongod.logs (which you can get in your dashboard), mine says 2016-03-21T11:43:34.234-0700 I ACCESS [conn133] SCRAM-SHA-1 authentication failed for oplog-reader on local from client <ip-address> ; UserNotFound Could not find user oplog-reader@local. So it must be something to do with not authenticating with the proper db. Like @pneumee below said, authSource should work but it doesn't for some reason. If this isn't helpful for you, maybe it will help someone from google. Lots of people converting to Galaxy right now :) - Shane Reustle

2 Answers

1
votes

The MONGO_OPLOG_URL should probably be:

mongodb://<oplog-reader-name>:<oploguserpassword>@ds<123456>-a0.mlab.com:<123456>,ds<123456>-a1.mlab.com:<123456>/local?authSource=admin&replicaSet=rs-ds<123456>

0
votes

Issue is resolved. I was informed by a member of the galaxy support team that

There have been issues with mLab connections and certain older Meteor versions, meteor 1.0.4.2 or higher should work.

After updating Meteor to 1.2.1. the deployed app finally connected to the db.

Note: When I simply ran meteor update, the project didn't actually get updated, even though no error was shown. Make sure to use meteor update --release x.x.x (x.x.x. replaced with the desired version) and check if the update worked with meteor --version afterwards.