[SERVER-803] Authentication & replication = exit on startup Created: 22/Mar/10  Updated: 12/Jul/16  Resolved: 22/Mar/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.3.3, 1.3.4
Fix Version/s: 1.3.5

Type: Bug Priority: Critical - P2
Reporter: Yun Huang Yong Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mon Mar 22 20:14:43 sys info: Linux promethium 2.6.24-27-xen #1 SMP Thu Jan 28 01:08:07 UTC 2010 x86_64 BOOST_LIB_VERSION=1_38


Participants:

 Description   

0. Completely clean data dir
1. Start mongo WITHOUT auth
2. Add admin & a local user: use local; db.addUser('repl', 'test')
3. Re-start mongod with --auth and --master, and get the following:

Mon Mar 22 20:14:43 Mongo DB : starting : pid = 14111 port = 27017 dbpath = /var/lib/mongodb master = 1 slave = 0 64-bit
Mon Mar 22 20:14:43 db version v1.3.4, pdfile version 4.5
Mon Mar 22 20:14:43 git version: nogitversion
Mon Mar 22 20:14:43 sys info: Linux promethium 2.6.24-27-xen #1 SMP Thu Jan 28 01:08:07 UTC 2010 x86_64 BOOST_LIB_VERSION=1_38
Mon Mar 22 20:14:43 waiting for connections on port 27017
Mon Mar 22 20:14:43 Assertion: 10057:unauthorized for db [local] lock type: 1

0x4d8ef1 0x5b404c 0x5b55d6 0x58bdbb 0x58c6e6 0x550484 0x61b0d5 0x61deac 0x61e438 0x62188e 0x7fa3dba34abd 0x48ed29
/usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x241) [0x4d8ef1]
/usr/bin/mongod(_ZN5mongo6Client7Context5_authEi+0x27c) [0x5b404c]
/usr/bin/mongod(_ZN5mongo6Client7Context11_finishInitEb+0x186) [0x5b55d6]
/usr/bin/mongod [0x58bdbb]
/usr/bin/mongod(_ZN5mongo7Helpers12getSingletonEPKcRNS_7BSONObjE+0x66) [0x58c6e6]
/usr/bin/mongod(_ZN5mongo16startReplicationEv+0x84) [0x550484]
/usr/bin/mongod(_ZN5mongo6listenEi+0x125) [0x61b0d5]
/usr/bin/mongod(_ZN5mongo14_initAndListenEiPKc+0x5ec) [0x61deac]
/usr/bin/mongod(_ZN5mongo13initAndListenEiPKc+0x18) [0x61e438]
/usr/bin/mongod(main+0x32de) [0x62188e]
/lib/libc.so.6(__libc_start_main+0xfd) [0x7fa3dba34abd]
/usr/bin/mongod [0x48ed29]
Mon Mar 22 20:14:43 exception in initAndListen std::exception: unauthorized for db [local] lock type: 1
, terminating
Mon Mar 22 20:14:43 dbexit:
Mon Mar 22 20:14:43 shutdown: going to close listening sockets...
Mon Mar 22 20:14:43 shutdown: going to flush oplog...
Mon Mar 22 20:14:43 shutdown: going to close sockets...
Mon Mar 22 20:14:43 shutdown: waiting for fs preallocator...
Mon Mar 22 20:14:43 shutdown: closing all files...
Mon Mar 22 20:14:43 closeAllFiles() finished
Mon Mar 22 20:14:43 shutdown: removing fs lock...
Mon Mar 22 20:14:43 dbexit: really exiting now

Starting without --auth is fine.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 26/Apr/10 ]

in a release

Comment by Yun Huang Yong [ 23/Mar/10 ]

Works for me, thanks for the quick fix.

Comment by auto [ 22/Mar/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-803 add pair test
http://github.com/mongodb/mongo/commit/8f7d5a26f5b0a53fabd8eb26c230029f1dc06b3d

Comment by auto [ 22/Mar/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-803 add test
http://github.com/mongodb/mongo/commit/07db021d74e7f23939fa49bbe10895b89632f67b

Comment by auto [ 22/Mar/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-803 make repl work when auth is enabled
http://github.com/mongodb/mongo/commit/82be9226a67a465e62615d088c90d6085f9e841d

Comment by Aaron Staple [ 22/Mar/10 ]

this commit seemed fix things in my manual testing. Working on an automated test now.

Generated at Thu Feb 08 02:55:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.