Using MONGO_OPLOG_URL causes crash on startup

Hello everyone,

I have been trying to add oplog polling to my Modulus/Compose hosted Meteor app. However, whenever I add the Oplog Env variable the server crashes on startup with the following error:

/mnt/app/node_modules/fibers/future.js:278
						throw(ex);
						      ^
MongoError: auth failed
    at Object.Future.wait (/mnt/app/node_modules/fibers/future.js:398:15)
    at new MongoConnection (packages/mongo/mongo_driver.js:213:1)
    at [object Object]._.extend._startTailing (packages/mongo/oplog_tailing.js:205:1)
    at new OplogHandle (packages/mongo/oplog_tailing.js:81:1)
    at new MongoConnection (packages/mongo/mongo_driver.js:216:1)
    at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:1)
    at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:1)
    at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
    at new Mongo.Collection (packages/mongo/collection.js:98:1)
    at packages/accounts-base/accounts_common.js:141:1
    - - - - -
    at Object.toError (/mnt/app/node_modules/mongodb/lib/mongodb/utils.js:114:11)
    at /mnt/app/node_modules/mongodb/lib/mongodb/db.js:1194:31
    at /mnt/app/node_modules/mongodb/lib/mongodb/db.js:1903:9
    at Server.Base._callHandler (/mnt/app/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
    at /mnt/app/node_modules/mongodb/lib/mongodb/connection/server.js:487:18
    at [object Object].MongoReply.parseBody (/mnt/app/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
    at [object Object].<anonymous> (/mnt/app/node_modules/mongodb/lib/mongodb/connection/server.js:445:20)
    at [object Object].emit (events.js:95:17)
    at [object Object].<anonymous> (/mnt/app/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
    at [object Object].emit (events.js:98:17)

The urls I use are as follow:

mongodb://user:password@c1.cockney.2.mongolayer.com:10001,c1.cockney.3.mongolayer.com:10001/webapp?replicaSet=set-55131972a7878c7b3e000048

mongodb://oploguser:oplogpassword@c1.cockney.2.mongolayer.com:10001,c1.cockney.3.mongolayer.com:10001/local?authSource=webapp”

the oplog user definitely has oplog access, I created it specifically for the last test 10 minutes ago.

I had this exact same problem and ended up just moving my app crack to the non-oplog database.

In assume those passwords are swapped out? You might want to check for special characters in your passwords that aren’t acceptable in a URL. This could have been my issue but I’ve not had the chance to try it again.

what are the meteor shell and server versions?

@valentin: it should be like that:
“MONGO_OPLOG_URL”:“mongodb://user:password@c1067.candidate.13.mongolayer.com:11067,candidate.12.mongolayer.com:11102/local?authSource=mydatabasename

Have a look at this blog:
https://www.compose.io/articles/meteor-and-compose-a-beginners-guide-to-using-them-together/

and this issue:

You may forget to add Oplog when creating user as well.

I have the same problem the day before when deploying a Meteor app into Digital Ocean with MUP

Good luck

Thank you for your answers! i was able to figure it out: I am stupid! I didnt delete the trailing " …