miwe
miwe

Reputation: 563

galaxy.meteor connection to mlab.com mongo database

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

Upvotes: 1

Views: 780

Answers (2)

miwe
miwe

Reputation: 563

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.

Upvotes: 0

pneumee
pneumee

Reputation: 494

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>

Upvotes: 1

Related Questions