[SERVER-22037] when i break command 'telnet localhost 27017' and the mongodb will shutdown automatically Created: 31/Dec/15  Updated: 06/Apr/18  Resolved: 22/Jun/16

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

Type: Bug Priority: Major - P3
Reporter: gch_chen [X] Assignee: Andrew Morrow (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Platforms 16 (06/24/16)
Participants:

 Description   

Hi, i'm fresh on MongoDB, i have finish install the MongoDB, and i can start the server sucessfully using following command
numactl --interleave=all ./mongod --fork --dbpath=/home/mongodb/mongodb/mongodb-linux-x86_64-rhel55-3.2.0/data --logpath=/home/mongodb/mongodb/mongodb-linux-x86_64-rhel55-3.2.0/logs/mongodb.log --logappend --journal

and i type command 'telnet localhost 27017', it show me 27017 is listening, but when i ctrl^C break this commad, mongodb will also shutdown, following as the log. would someone can give a help..
Many thanks

----server information —
MongoDB version: mongodb-linux-x86_64-rhel55-3.2.0
server version: Red Hat Enterprise Linux Server release 5.4 (Tikanga)

-----log-----

2015-12-31T18:04:55.623+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten] MongoDB starting : pid=5793 port=27017 dbpath=/home/mongodb/mongodb/mongodb-linux-x86_64-rhel55-3.2.0/data 64-bi
t host=rhel1.transforex
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten] db version v3.2.0
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten] git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten] modules: none
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten] build environment:
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten]     distmod: rhel55
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten]     distarch: x86_64
2015-12-31T18:04:55.633+0800 I CONTROL  [initandlisten]     target_arch: x86_64
ngodb.log" } }
storage engine, so setting the active storage engine to 'wiredTiger'.
y.
2015-12-31T18:04:55.669+0800 W STORAGE  [initandlisten] Recovering data from the last clean checkpoint.
0),
2015-12-31T18:04:56.850+0800 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
-3.2.0/data/diagnostic.data'
2015-12-31T18:04:56.851+0800 I NETWORK  [initandlisten] waiting for connections on port 27017
2015-12-31T18:04:57.028+0800 I FTDC     [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK
2015-12-31T18:04:58.798+0800 I NETWORK  [initandlisten] connection accepted from 10.72.32.99:34456 #1 (1 connection now open)
2015-12-31T18:05:00.015+0800 I NETWORK  [initandlisten] connection accepted from 10.72.32.99:34457 #2 (2 connections now open)
2015-12-31T18:05:00.304+0800 I NETWORK  [initandlisten] connection accepted from 10.72.32.99:34458 #3 (3 connections now open)
2015-12-31T18:05:16.730+0800 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:60553 #4 (4 connections now open)
2015-12-31T18:05:18.622+0800 F -        [conn4] terminate() called. An exception is active; attempting to gather more information
2015-12-31T18:05:18.628+0800 F -        [conn4] DBException::toString(): 17132 SSL handshake received but server is started without SSL support
Actual exception type: mongo::UserException
 
 0x12f85d2 0x12f7f02 0x35944bcdb6 0x35944bcde3 0x35944bceca 0x127fc02 0x12a2255 0x49b3f6d0
----- BEGIN BACKTRACE -----
elfType" : 3 }, { "path" : "/lib64/libselinux.so.1", "elfType" : 3 }, { "path" : "/lib64/libsepol.so.1", "elfType" : 3 } ] }}
 mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x12f85d2]
 mongod(+0xEF7F02) [0x12f7f02]
 libstdc++.so.6(+0xBCDB6) [0x35944bcdb6]
 libstdc++.so.6(+0xBCDE3) [0x35944bcde3]
 libstdc++.so.6(+0xBCECA) [0x35944bceca]
 mongod(_ZN5mongo9uassertedEiPKc+0x142) [0x127fc02]
 mongod(_ZN5mongo13MessagingPort4recvERNS_7MessageE+0xB45) [0x12a2255]
 ??? [0x49b3f6d0]
-----  END BACKTRACE  -----



 Comments   
Comment by Andrew Morrow (Inactive) [ 22/Jun/16 ]

I've just tested this with the following two versions of MongoDB on RHEL 5.5:

  • mongodb-linux-x86_64-rhel55-3.2.7-26-g9756d82
  • mongodb-linux-x86_64-rhel55-3.3.8-192-gb022cc6

In both cases, typing four ^C characters into the telnet session does result in an error being reported on the server, and the connection being closed, but the server does not crash.

Note that typing ^C into a telnet session is not the intended way of breaking a telnet session. Instead one should escape with the currently configured telnet escape sequence (by default, ^]), and then exit telnet with ^D to close the connection.

The error is reported on the server because the four ^C bytes are transmitted, and appear to match some portion of the required communication prelude.

Comment by gch_chen [X] [ 31/Dec/15 ]

and i found another issue on the log

----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"400000","o":"EF85D2"},{"b":"400000","o":"EF7F02"},{"b":"3594400000","o":"BCDB6"},{"b":"3594400000","o":"BCDE3"},{"b":"3594400000","o":"BCECA"},{"b":"400000","o":"E7FC02"},{"b":"400000","o":"EA2255"},{"b":"0","o":"49B3F6D0"}],"processInfo":{ "mongodbVersion" : "3.2.0", "gitVersion" : "45d947729a0315accb6d4f15a6b06be6d9c19fe7", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "2.6.18-164.el5", "version" : "#1 SMP Tue Aug 18 15:51:48 EDT 2009", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000" }, { "path" : "/lib64/libssl.so.6", "elfType" : 3 }, { "path" : "/lib64/libcrypto.so.6", "elfType" : 3 }, { "path" : "/lib64/librt.so.1", "elfType" : 3 }, { "path" : "/lib64/libdl.so.2", "elfType" : 3 }, { "path" : "/usr/lib64/libstdc++.so.6", "elfType" : 3 }, { "path" : "/lib64/libm.so.6", "elfType" : 3 }, { "path" : "/lib64/libgcc_s.so.1", "elfType" : 3 }, { "path" : "/lib64/libpthread.so.0", "elfType" : 3 }, { "path" : "/lib64/libc.so.6", "elfType" : 3 }, { "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3 }, { "path" : "/usr/lib64/libgssapi_krb5.so.2", "elfType" : 3 }, { "path" : "/usr/lib64/libkrb5.so.3", "elfType" : 3 }, { "path" : "/lib64/libcom_err.so.2", "elfType" : 3 }, { "path" : "/usr/lib64/libk5crypto.so.3", "elfType" : 3 }, { "path" : "/usr/lib64/libz.so.1", "elfType" : 3 }, { "path" : "/usr/lib64/libkrb5support.so.0", "elfType" : 3 }, { "path" : "/lib64/libkeyutils.so.1", "elfType" : 3 }, { "path" : "/lib64/libresolv.so.2", "elfType" : 3 }, { "path" : "/lib64/libselinux.so.1", "elfType" : 3 }, { "path" : "/lib64/libsepol.so.1", "elfType" : 3 } ] }}
 mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x12f85d2]

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