|
Thanks Ramon for getting back to me.
1. Yes, I had authentication setup in both 2.4 and 2.6.
2. & 3. User creations and full server logs are attached.
User Creation with mongodb 2.4
------------------------------
cogadmin@UBLNX-pj4:~$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> use test
switched to db test
> db.addUser('theuser', 'passw0rd');
{
"user" : "theuser",
"readOnly" : false,
"pwd" : "a7ff4ec639b3681fc2b96eaefffb1b53",
"_id" : ObjectId("54c193f81fb304023ddf2dcc")
}
> db.auth('theuser', 'passw0rd');
1
>
Nodejs app server log (with mongodb 2.4)
----------------------------------------
22 Jan 16:43:19 - [nodemon] v1.2.1
22 Jan 16:43:19 - [nodemon] to restart at any time, enter `rs`
22 Jan 16:43:19 - [nodemon] watching: /home/cogadmin/dctc/CogilityNode/Runtime/migrations/*/
22 Jan 16:43:19 - [nodemon] starting `node /home/cogadmin/dctc/CogilityNode/Runtime/app.js`
Failed to load c++ bson extension, using pure JS version
2015-01-23T00:43:20.448Z <warn> globals.js:45 () Schema Version unspecified
2015-01-23T00:43:20.454Z <warn> globals.js:45 () ENV = undefined
2015-01-23T00:43:20.455Z <warn> globals.js:45 () PROCESS VERSION = v0.10.25
2015-01-23T00:43:20.456Z <warn> globals.js:45 () MONGO URI = mongodb://theuser:passw0rd@localhost:27017/test
2015-01-23T00:43:20.531Z <info> globals.js:45 () 'pearschemamasters' and 'pearschemadetails' already exist. Continue.
2015-01-23T00:43:20.535Z <warn> globals.js:45 () Server running on port 3000
2015-01-23T00:43:20.540Z <warn> globals.js:45 () !!!! There are no PearSchema instances in the database.
User Creation with mongodb 2.6
------------------------------
cogadmin@UBLNX-pj4:~$ mongo
MongoDB shell version: 2.6.7
connecting to: test
> use test;
switched to db test
> db.addUser('theuser', 'passw0rd');
WARNING: The 'addUser' shell helper is DEPRECATED. Please use 'createUser' instead
Successfully added user:
{ "user" : "theuser", "roles" : [ "dbOwner" ] }
> db.auth('theuser', 'passw0rd');
1
>
Nodejs app server log (with mongodb 2.6)
----------------------------------------
22 Jan 17:11:40 - [nodemon] v1.2.1
22 Jan 17:11:40 - [nodemon] to restart at any time, enter `rs`
22 Jan 17:11:40 - [nodemon] watching: /home/cogadmin/dctc/CogilityNode/Runtime/migrations/*/
22 Jan 17:11:40 - [nodemon] starting `node /home/cogadmin/dctc/CogilityNode/Runtime/app.js`
Failed to load c++ bson extension, using pure JS version
2015-01-23T01:11:40.819Z <warn> globals.js:45 () Schema Version unspecified
2015-01-23T01:11:40.825Z <warn> globals.js:45 () ENV = undefined
2015-01-23T01:11:40.826Z <warn> globals.js:45 () PROCESS VERSION = v0.10.25
2015-01-23T01:11:40.827Z <warn> globals.js:45 () MONGO URI = mongodb://theuser:passw0rd@localhost:27017/test
2015-01-23T01:11:40.906Z <info> globals.js:45 () 'pearschemamasters' and 'pearschemadetails' created.
2015-01-23T01:11:40.914Z <warn> globals.js:45 () Server running on port 3000
2015-01-23T01:11:40.967Z <warn> globals.js:45 () !!!! There are no PearSchema instances in the database.
User Creation with mongodb 2.8
-------------------------------------------
cogadmin@UBLNX-pj4:~$ mongo
MongoDB shell version: 2.8.0-rc5
connecting to: test
Server has startup warnings:
2015-01-22T17:59:22.985-0800 I CONTROL [initandlisten]
2015-01-22T17:59:22.985-0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-01-22T17:59:22.986-0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-01-22T17:59:22.986-0800 I CONTROL [initandlisten]
> use test
switched to db test
> db.createUser(
{user: "theuser", pwd: "passw0rd", roles: ["readWrite", "dbAdmin"]}
);
Successfully added user:
{ "user" : "theuser", "roles" : [ "readWrite", "dbAdmin" ] }
> db.auth('theuser', 'passw0rd');
1
>
> db.getUser('theuser');
{
"_id" : "test.theuser",
"user" : "theuser",
"db" : "test",
"roles" : [
{
"role" : "readWrite",
"db" : "test"
}
,
{
"role" : "dbAdmin",
"db" : "test"
}
]
}
>
Nodejs app server log (with mongodb 2.8)
-------------------------------------------------------
22 Jan 18:13:11 - [nodemon] v1.2.1
22 Jan 18:13:11 - [nodemon] to restart at any time, enter `rs`
22 Jan 18:13:11 - [nodemon] watching: /home/cogadmin/dctc/CogilityNode/Runtime/migrations/*/
22 Jan 18:13:11 - [nodemon] starting `node /home/cogadmin/dctc/CogilityNode/Runtime/app.js`
Failed to load c++ bson extension, using pure JS version
2015-01-23T02:13:12.082Z <warn> globals.js:45 () Schema Version unspecified
2015-01-23T02:13:12.088Z <warn> globals.js:45 () ENV = undefined
2015-01-23T02:13:12.089Z <warn> globals.js:45 () PROCESS VERSION = v0.10.25
2015-01-23T02:13:12.091Z <warn> globals.js:45 () MONGO URI = mongodb://theuser:passw0rd@localhost:27017/test
2015-01-23T02:13:12.157Z <error> globals.js:45 () #### Error in connecting to mongodb
2015-01-23T02:13:12.159Z <error> globals.js:45 ()
{ [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }
2015-01-23T02:13:12.161Z <error> globals.js:45 () MongoError: auth failed
at Db.wrap (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:1931:11)
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:686:30
at null.<anonymous> (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:1808:5)
at g (events.js:180:16)
at EventEmitter.emit (events.js:106:17)
at Db._callHandler (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:1506:25)
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/connection/server.js:478:30
at MongoReply.parseBody (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:127:5)
at null.<anonymous> (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/connection/server.js:435:22)
at EventEmitter.emit (events.js:95:17)
-
-
-
- Uncaught error: [ReferenceError: mongoDb is not defined] ReferenceError: mongoDb is not defined
at /home/cogadmin/dctc/CogilityNode/Runtime/interfaces/pearMongo/mongo.js:33:24
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/mongo_client.js:103:20
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:2118:11
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:700:13
at null.<anonymous> (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:1808:5)
at g (events.js:180:16)
at EventEmitter.emit (events.js:106:17)
at Db._callHandler (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:1506:25)
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/connection/server.js:478:30
at MongoReply.parseBody (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:127:5)
2015-01-23T02:13:12.165Z <error> globals.js:45 () #### Uncaught error in master: ReferenceError: mongoDb is not defined
2015-01-23T02:13:12.167Z <error> globals.js:45 () ReferenceError: mongoDb is not defined
at /home/cogadmin/dctc/CogilityNode/Runtime/interfaces/pearMongo/mongo.js:33:24
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/mongo_client.js:103:20
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:2118:11
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:700:13
at null.<anonymous> (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:1808:5)
at g (events.js:180:16)
at EventEmitter.emit (events.js:106:17)
at Db._callHandler (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/db.js:1506:25)
at /home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/connection/server.js:478:30
at MongoReply.parseBody (/home/cogadmin/dctc/CogilityNode/Runtime/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:127:5)
|