Differential / meteor-workers

Spawn headless worker meteor processes to work on async jobs.
80 stars 9 forks source link

Authentication error with mongodb 3.0 #21

Open lowi opened 8 years ago

lowi commented 8 years ago

I get the error mongo auth failed when trying to use this package.

deatheragetr commented 8 years ago

Although details for the above are scant, I think I'm encountering the same problem. From the logs:

2016-04-03 20:45:41-04:00{ [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }
ksq9
2016-04-03 20:45:41-04:00{ [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }
ksq9
2016-04-03 20:45:41-04:00{ [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }
ksq9
2016-04-03 20:45:41-04:00
ksq9
2016-04-03 20:45:41-04:00/app/bundle/programs/server/npm/differential_workers/node_modules/monq/node_modules/mongoskin/node_modules/mongodb/lib/mongodb/mongo_client.js:434
ksq9
2016-04-03 20:45:41-04:00 throw err
ksq9
2016-04-03 20:45:41-04:00 ^
ksq9
2016-04-03 20:45:42-04:00ReferenceError: Workers is not defined
ksq9
2016-04-03 20:45:42-04:00 at callback (packages/differential_workers/lib/Job.coffee:22:23)
ksq9
2016-04-03 20:45:42-04:00 at /app/bundle/programs/server/npm/differential_workers/node_modules/monq/lib/job.js:31:25
ksq9
2016-04-03 20:45:42-04:00 at onError (/app/bundle/programs/server/npm/differential_workers/node_modules/monq/node_modules/mongoskin/lib/utils.js:27:7)
ksq9
2016-04-03 20:45:42-04:00 at EventEmitter.<anonymous> (/app/bundle/programs/server/npm/differential_workers/node_modules/monq/node_modules/mongoskin/lib/utils.js:118:15)
ksq9
2016-04-03 20:45:42-04:00 at EventEmitter.g (events.js:180:16)
ksq9
2016-04-03 20:45:42-04:00 at EventEmitter.emit (events.js:117:20)
ksq9
2016-04-03 20:45:42-04:00 at /app/bundle/programs/server/npm/differential_workers/node_modules/monq/node_modules/mongoskin/lib/utils.js:169:27
ksq9
2016-04-03 20:45:42-04:00 at EventEmitter.<anonymous> (/app/bundle/programs/server/npm/differential_workers/node_modules/monq/node_modules/mongoskin/lib/collection.js:50:22)
ksq9
2016-04-03 20:45:42-04:00 at EventEmitter.g (events.js:180:16)
ksq9
2016-04-03 20:45:42-04:00 at EventEmitter.emit (events.js:98:17)

In my case, I'm deploying to galaxy.meteor.com and am using mLab's sandbox DB for my MongoDB store. Authenticating against mongo in other parts of the codebase seems to occur correctly (for example, I can confirm when logging into the db via the command line, all the expected application collections are there).

Any help is gravely appreciated. Thank you.

sleepycamel commented 8 years ago

I'm having exactly the same problem:

I20160412-20:41:34.890(-4)? PID 2192148: Started 5 monq workers.
W20160412-20:41:35.183(-4)? (STDERR) { [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }

The DB is otherwise fine, and the app connects to it fine as usual. It's also a sandbox mongo at mLab. What's the best way to try and troubleshoot this? Is there something that needs to be done to ensure that MONGO_URL is propagated to child processes?

bluxu commented 8 years ago

I also have this. I think it's something to do with monq and/or mongoskin not supporting Mongo 3.0... Has anyone been able to solve it?

bluxu commented 8 years ago

This seems to be the relevant fix of monq. Interestingly the differential:workers package depends only on the previous release. Updating seems to break the package...

bluxu commented 8 years ago

Ah I see - it's fixed in this PR.