[SERVER-10890] Mongostat traceback when fail to provide auth in sharded/replicated env. Created: 25/Sep/13  Updated: 10/Dec/14  Resolved: 19/Dec/13

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

Type: Bug Priority: Major - P3
Reporter: Kevin J. Rice Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates TOOLS-34 mongostat --discover fails with "Ass... Closed
Operating System: ALL
Steps To Reproduce:
  • have a sharded replicated mongo instance that requires user/pass to connect to properly;
  • run mongostat --discover on a mongos for that cluster without providing user/pass
Participants:

 Description   

Sharded replicated environment.
mongostat --version says 2.4.6

I'm specifying a host and port, but not providing user and pass despite needing to do so. Instead of saying, 'not authorized', I get a traceback.

TB is as follows (hostnames changed to protect the innocent):

command line:
mongostat --host boxname1 --port 40103 --discover

connected to: boxname1:40103
Wed Sep 25 09:01:00.995 Assertion: 13111:field not found, expected type 2
0xddfb01 0xda2a5b 0xda2f9c 0x6d48d6 0x6dbd54 0x6cf386 0xe285e9 0x3d32a07851 0x3d322e890d
mongostat(_ZN5mongo15printStackTraceERSo+0x21) [0xddfb01]
mongostat(_ZN5mongo11msgassertedEiPKc+0x9b) [0xda2a5b]
mongostat() [0xda2f9c]
mongostat(_ZNK5mongo11BSONElement6StringEv+0x1c6) [0x6d48d6]
mongostat(_ZN5mongo4Stat12serverThreadEN5boost10shared_ptrINS0_11ServerStateEEEi+0x5f4) [0x6dbd54]
mongostat(_ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN5mongo4Stat11ServerStateEEEiENS2_5list2INS2_5valueIS8_EENSC_IiEEEEEEE3runEv+0x46) [0x6cf386]
mongostat() [0xe285e9]
/lib64/libpthread.so.0() [0x3d32a07851]
/lib64/libc.so.6(clone+0x6d) [0x3d322e890d]



 Comments   
Comment by Daniel Pasette (Inactive) [ 19/Dec/13 ]

duplicate of SERVER-10465

Comment by Michael Grundy [ 25/Sep/13 ]

Hey Kevin -

I believe this is a dupe of SERVER-9698 , which was fixed in 2.5.2. Could you give the 2.5.2 dev release (or nightly) a try and see if it is resolved in your test case?

Thanks!
Mike

Comment by Nick Pellant [ 25/Sep/13 ]

Confirmed.

$ mongod --auth
Wed Sep 25 15:27:20.293 [initandlisten] MongoDB starting : pid=4309 port=27017 dbpath=/data/db/ 64-bit host=Gianfranco-10gen.local
Wed Sep 25 15:27:20.293 [initandlisten] db version v2.4.6
Wed Sep 25 15:27:20.293 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Wed Sep 25 15:27:20.293 [initandlisten] build info: Darwin bs-osx-106-x86-64-2.10gen.cc 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Wed Sep 25 15:27:20.294 [initandlisten] allocator: system
Wed Sep 25 15:27:20.294 [initandlisten] options: { auth: true }
Wed Sep 25 15:27:20.296 [initandlisten] journal dir=/data/db/journal
Wed Sep 25 15:27:20.296 [initandlisten] recover : no journal files present, no recovery needed
Wed Sep 25 15:27:20.370 [websvr] admin web console waiting for connections on port 28017
Wed Sep 25 15:27:20.370 [initandlisten] waiting for connections on port 27017
Wed Sep 25 15:27:22.182 [initandlisten] connection accepted from 127.0.0.1:53962 #1 (1 connection now open)
Wed Sep 25 15:27:22.183 [initandlisten] connection accepted from 127.0.0.1:53963 #2 (2 connections now open)
Wed Sep 25 15:27:22.183 [conn2] command denied: { serverStatus: 1 }

$ mongostat --version
mongostat version 2.4.6
 
$ mongostat --discover
connected to: 127.0.0.1
Wed Sep 25 15:27:22.183 Assertion: 13111:field not found, expected type 2
0x10044b6db 0x10042666e 0x10042672d 0x1003f4880 0x1003f4909 0x100008f19 0x1000021a8 0x100002268 0x10047ded5 0x7fff8d741772 0x7fff8d72e1a1
 0   mongostat                           0x000000010044b6db _ZN5mongo15printStackTraceERSo + 43
 1   mongostat                           0x000000010042666e _ZN5mongo11msgassertedEiPKc + 174
 2   mongostat                           0x000000010042672d _ZN5mongo11msgassertedEiRKSs + 29
 3   mongostat                           0x00000001003f4880 _ZNK5mongo11BSONElement3chkEi + 800
 4   mongostat                           0x00000001003f4909 _ZNK5mongo11BSONElement6StringEv + 41
 5   mongostat                           0x0000000100008f19 _ZN5mongo4Stat12serverThreadEN5boost10shared_ptrINS0_11ServerStateEEEi + 1737
 6   mongostat                           0x00000001000021a8 _ZN5boost3_bi5list2INS0_5valueINS_10shared_ptrIN5mongo4Stat11ServerStateEEEEENS2_IiEEEclIPFvS7_iENS0_5list0EEEvNS0_4typeIvEERT_RT0_i + 50
 7   mongostat                           0x0000000100002268 _ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN5mongo4Stat11ServerStateEEEiENS2_5list2INS2_5valueIS8_EENSC_IiEEEEEEE3runEv + 42
 8   mongostat                           0x000000010047ded5 thread_proxy + 229
 9   libsystem_c.dylib                   0x00007fff8d741772 _pthread_start + 327
 10  libsystem_c.dylib                   0x00007fff8d72e1a1 thread_start + 13

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