[SERVER-2524] mongod crashes when rs.initiate() called without arguments Created: 10/Feb/11  Updated: 30/Mar/12  Resolved: 16/Feb/11

Status: Closed
Project: Core Server
Component/s: Replication, Stability
Affects Version/s: 1.7.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mike Copley Assignee: Kristina Chodorow (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X 10.6.6, 32bit prebuilt server from website


Attachments: File runBug.sh     File test.js    
Operating System: OS X
Participants:

 Description   

monogd dies when issuing 'rs.initiate()' from shell. Would have expected an error message but not death.

./bin/mongod --replSet sample --port 23001 --dbpath /data --auth --keyFile /data/replicaPassphrase.txt --oplogSize=200 --smallfiles --rest --fork --logpath /data/log/sample.log

./bin/mongo --port 23001
MongoDB shell version: 1.7.5
connecting to: 127.0.0.1:23001/test
> rs.initiate();
Thu Feb 10 10:15:53 DBClientCursor::init call() failed
Thu Feb 10 10:15:53 query failed : admin.$cmd

{ replSetInitiate: undefined }

to: 127.0.0.1:23001
Thu Feb 10 10:15:53 Error: error doing query: failed shell/collection.js:150
Thu Feb 10 10:15:53 trying reconnect to 127.0.0.1:23001
Thu Feb 10 10:15:53 reconnect 127.0.0.1:23001 failed couldn't connect to server 127.0.0.1:23001

From the log file:

Thu Feb 10 10:15:47 [initandlisten] MongoDB starting : pid=30903 port=23001 dbpath=/data/nz1-e 32-bit

    • NOTE: This is a development version (1.7.5) of MongoDB.
    • Not recommended for production.

Thu Feb 10 10:15:47 [initandlisten] db version v1.7.5, pdfile version 4.5
Thu Feb 10 10:15:47 [initandlisten] git version: 7ccac7109dccc0384b761f6b02b9788342c5eabb
Thu Feb 10 10:15:47 [initandlisten] sys info: Darwin broadway.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Thu Feb 10 10:15:47 [initandlisten] waiting for connections on port 23001
Thu Feb 10 10:15:47 [websvr] web admin interface listening on port 24001
Thu Feb 10 10:15:47 [initandlisten] connection accepted from 127.0.0.1:50457 #1
Thu Feb 10 10:15:47 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Thu Feb 10 10:15:47 [startReplSets] replSet info you may need to run replSetInitiate – rs.initiate() in the shell – if that is not already done
Thu Feb 10 10:15:50 [initandlisten] connection accepted from 127.0.0.1:50458 #2
Thu Feb 10 10:15:53 [conn2] replSet replSetInitiate admin command received from client
Thu Feb 10 10:15:53 [conn2] note: no users configured in admin.system.users, allowing localhost access
Thu Feb 10 10:15:53 [conn2] replSet info initiate : no configuration specified. Using a default configuration for the set
Thu Feb 10 10:15:53 [conn2] replSet created this configuration for initiation : { _id: "sample", members: [

{ _id: 0, host: "blah.local:23001" }

] }
Thu Feb 10 10:15:53 [conn2] replSet replSetInitiate config object parses ok, 1 members specified
Thu Feb 10 10:15:53 [initandlisten] connection accepted from 10.211.55.2:50459 #3
Thu Feb 10 10:15:53 [conn2] replSet replSetInitiate all members seem up
Thu Feb 10 10:15:53 [conn2] ******
Thu Feb 10 10:15:53 [conn2] creating replication oplog of size: 200MB...
Thu Feb 10 10:15:53 Got signal: 6 (Abort trap).

Thu Feb 10 10:15:53 Backtrace:
0x47008c 0x9700e46b 0xffffffff 0x46a43b 0x47108b 0x47187a 0x47350b 0x2176
0 mongod 0x0047008c _ZN5mongo10abruptQuitEi + 396
1 libSystem.B.dylib 0x9700e46b _sigtramp + 43
2 ??? 0xffffffff 0x0 + 4294967295
3 mongod 0x0046a43b _ZN5mongo6listenEi + 219
4 mongod 0x0047108b _ZN5mongo14_initAndListenEiPKc + 2171
5 mongod 0x0047187a _ZN5mongo13initAndListenEiPKc + 42
6 mongod 0x0047350b main + 4939
7 mongod 0x00002176 start + 54

Thu Feb 10 10:15:53 dbexit:
Thu Feb 10 10:15:53 [initandlisten] shutdown: going to close listening sockets...

This is on OS X 10.6.6, 32bit binary. Haven't tried on other environments.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 16/Feb/11 ]

See SERVER-2514

Comment by Mike Copley [ 16/Feb/11 ]

You can close this as being a dupe of SERVER-2514 which was fixed in 1.7.6

Comment by Mike Copley [ 10/Feb/11 ]

Tested on 1.7.5 for Linux i686, could not reproduce. Replica came up fine.
Tested on nightly (mongodb-osx-i386-2011-02-03) on OS X 10.6.6, still crashes. So looks like just OS X problem.

Comment by Mike Copley [ 10/Feb/11 ]

runBug creates 3 mongod instances, assumes data directories are in /tmp/mongod-test/sample-[a,b,c]/
Run from the root level of the mongod installation directory (needs ./bin/mongod)

Comment by Mike Copley [ 10/Feb/11 ]

I'm attaching a script that can reproduce this - it doesn't matter what is passed to rs.initiate(), it always crashes.

The script creates 3 instances (ports 23001, 23002, 23003) and tries to establish a replica set between then. The rs.initiate(cfg) crashes.

Usage:
./runBug.sh

After running it will only have 2 instances running (23002, 23003) as 23001 (sample-a) has crashed. To re-run test, first kill the left over mongod instances.

Generated at Thu Feb 08 03:00:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.