mongoose: Mongoose not connecting with SCRAM-SHA-1

Given the following setup:

Crispens-MacBook-Pro:site crispensmith$ npm list | grep mongodb
│ ├─┬ mongodb@2.0.49
│ │ ├── mongodb-core@1.2.24
 npm ERR! peer dep missing: kerberos@~0.0, required by mongodb-core@1.2.24

Crispens-MacBook-Pro:site crispensmith$ npm list | grep mongoose
├── locomotive-mongoose@0.1.0
├─┬ mongoose@4.2.8
├── mongoose-types@1.0.3
npm ERR! peer dep missing: kerberos@~0.0, required by mongodb-core@1.2.24

on osX Yosemite (10.10.5), with connection being executed in the following code block:

module.exports = function () {
    this.mongoose = require('mongoose');
this.mongooseTypes = require("mongoose-types");
this.mongooseTypes.loadTypes(this.mongoose);
this.mongoose.connect(mongoURL);
};

This works:

var mongoURL = "mongodb://localhost/ofDreamsAndShadows";

but this does not:

var mongoURL = "mongodb://ods_db_login:0ds123@ds055594.mongolab.com:55594/of_dreams_and_shadows_dev?authMechanism=SCRAM-SHA-1"`

However cli login to the mongolabs instance is working as expected.

This suggests that this is an issue with Authentication (the unmet kerberos dep?) .

However, I’ve also tried on a cloud instance .

I’m including the output of npm start on my local machine as cloud instance logs are much more verbose but the critical line is the same in both instances.

Crispens-MacBook-Pro:site crispensmith$ npm start

> Of_Dreams_and_Shadows_1_pager@0.0.1 start /Users/crispensmith/Documents/goal/Site
> node node_modules/locomotive/bin/lcm.js server

CLI ENV: development
Locomotive 0.4.2 application starting in development on http://0.0.0.0:3000
HTTP server listening on 0.0.0.0:3000

/Users/crispensmith/Documents/goal/Site/node_modules/mongodb/lib/utils.js:98
 process.nextTick(function() { throw err; });
                               ^
MongoError: Authentication failed.
    at Function.MongoError.create (/Users/crispensmith/Documents/goal/Site/node_modules/mongodb-core/lib/error.js:31:11)
at /Users/crispensmith/Documents/goal/Site/node_modules/mongodb-core/lib/topologies/server.js:776:66
at Callbacks.emit (/Users/crispensmith/Documents/goal/Site/node_modules/mongodb-core/lib/topologies/server.js:95:3)
at null.messageHandler (/Users/crispensmith/Documents/goal/Site/node_modules/mongodb-core/lib/topologies/server.js:249:23)
at Socket.<anonymous> (/Users/crispensmith/Documents/goal/Site/node_modules/mongodb-core/lib/connection/connection.js:262:22)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)
at TCP.onread (net.js:523:20)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 18

Most upvoted comments

Weird. Glad you got it working, happy new year.

Does your username or password contain any special characters like :, @, etc. or are they alphanumeric?