[SERVER-972] mongod crashes when running with --auth and a mongo shell connecting without -u & -p Created: 06/Apr/10  Updated: 17/Mar/11  Resolved: 16/Jan/11

Status: Closed
Project: Core Server
Component/s: Stability
Affects Version/s: 1.4.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: John-Paul Bader Assignee: Eliot Horowitz (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

FreeBSD 7.2-RELEASE-p5, mongod running inside a Jail. FreeBSD Jails have no localhost so mongod is specifically bound to the Jails external IP. Shared Memory is enabled.


Participants:

 Description   

I installed mongodb via the FreeBSD ports and added an admin user as described on the website. I added these three lines to /usr/local/etc/mongo.conf:

dbpath = /var/db/mongodb
bind_ip = xx.xx.xxx.xxx
auth = true

Then started it via: ./usr/local/etc/rc.d/mongod start

Everything went fine whenn I connected via the mongo shell supplying proper -u and -p parameters. However if I start mongo without any parameters mongod crashes after the first query. This is the log of exactly one such session. Starting mongod, connecting, first query, boom:

Mon Apr 5 22:30:19 Mongo DB : starting : pid = 86330 port = 27017 dbpath = /var/db/mongodb master = 0 slave = 0 32-bit

Mon Apr 5 22:30:19 db version v1.4.0, pdfile version 4.5
Mon Apr 5 22:30:19 git version: nogitversion
Mon Apr 5 22:30:19 sys info: FreeBSD xxxxxxxx 7.2-RELEASE-p5 FreeBSD 7.2-RELEASE-p5 #0: Wed Dec 9 21:41:28 CET 2009 i386 BOOST_LIB_VERSION=1_41
Mon Apr 5 22:30:19 waiting for connections on port 27017
Mon Apr 5 22:30:19 web admin interface listening on port 28017
Mon Apr 5 22:30:27 connection accepted from xxxxxxxxxxxxx:61762 #1
Mon Apr 5 22:30:30 Assertion: 10057:unauthorized for db [test] lock type: -1

Mon Apr 5 22:30:30 Got signal: 6 (Abort trap: 6).
Mon Apr 5 22:30:30 Backtrace:
Mon Apr 5 22:30:30 dbexit:
Mon Apr 5 22:30:30 shutdown: going to close listening sockets...
Mon Apr 5 22:30:30 going to close listening socket: 5
Mon Apr 5 22:30:30 going to close listening socket: 7
Mon Apr 5 22:30:30 shutdown: going to flush oplog...
Mon Apr 5 22:30:30 shutdown: going to close sockets...
Mon Apr 5 22:30:30 shutdown: waiting for fs preallocator...
Mon Apr 5 22:30:30 shutdown: closing all files...
Mon Apr 5 22:30:30 closeAllFiles() finished
Mon Apr 5 22:30:30 shutdown: removing fs lock...
Mon Apr 5 22:30:30 dbexit: really exiting now

I will try that on a FreeBSD 8.0 Jail today and update the ticket accordingly.



 Comments   
Comment by John-Paul Bader [ 06/Apr/10 ]

Just tried to replicate this on FreeBSD 8.0 but wasn't able to. Behaves as expected I assume so that this seems to be FreeBSD 7.2 related.

Tue Apr 6 07:55:40 connection accepted from xxx.xxx.xxx.xxx:63051 #1
Tue Apr 6 07:55:45 Assertion: 10057:unauthorized for db [test] lock type: -1

Tue Apr 6 07:55:45 Caught Assertion in runQuery ns:test.system.users massert:unauthorized for db [test] lock type: -1

Tue Apr 6 07:55:45 ntoskip:0 ntoreturn:0
Tue Apr 6 07:55:45 query:{}
Tue Apr 6 07:55:45 query test.system.users ntoreturn:0 exception 14ms
Tue Apr 6 07:56:00 end connection xxx.xxx.xxx.xxx:63051

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