[SERVER-60551] Occasionally getting "Initialized wire specification" when connecting Created: 08/Oct/21  Updated: 29/Oct/23  Resolved: 12/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.3
Fix Version/s: 5.0.13, 6.0.2, 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Wernfried Domscheit Assignee: Ryan Egesdahl (Inactive)
Resolution: Fixed Votes: 1
Labels: shell
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0, v5.0
Steps To Reproduce:

Not reproducible, happens only occasionally.

Participants:
Case:

 Description   

I just upgraded my Sharded cluster to version 5.0.3. Sometime when I connect to mongos then I get this information message:

{
	"t": {
		"$date": "2021-10-08T08:02:49.206Z"
	},
	"s": "I",
	"c": "NETWORK",
	"id": 4915701,
	"ctx": "-",
	"msg": "Initialized wire specification",
	"attr": {
		"spec": {
			"incomingExternalClient": {
				"minWireVersion": 0,
				"maxWireVersion": 13
			},
			"incomingInternalClient": {
				"minWireVersion": 0,
				"maxWireVersion": 13
			},
			"outgoing": {
				"minWireVersion": 0,
				"maxWireVersion": 13
			},
			"isInternalClient": false
		}
	}
}

For me this is a problem, because the mongo script runs as automatic job and a non-emtpy return value is considered as an error. Apart from that, it is annoying for the user.

 

Is the a solution to get rid of this message?

 



 Comments   
Comment by Githook User [ 13/Sep/22 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-60551 Fix mongo (shell) initializer stages

(cherry picked from commit 72344e39acd0f26a3b72a68520edde77483e69c9)
(cherry picked from commit 1451ddccfc4d24b3686a4851d17c82cbf3d7f35b)
Branch: v5.0
https://github.com/mongodb/mongo/commit/613271f381c0949e736c58c4a486d2a3da369788

Comment by Githook User [ 13/Sep/22 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-60551 Fix mongo (shell) initializer stages

(cherry picked from commit 72344e39acd0f26a3b72a68520edde77483e69c9)
Branch: v6.0
https://github.com/mongodb/mongo/commit/1451ddccfc4d24b3686a4851d17c82cbf3d7f35b

Comment by Githook User [ 12/Sep/22 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-60551 Fix mongo (shell) initializer stages
Branch: master
https://github.com/mongodb/mongo/commit/72344e39acd0f26a3b72a68520edde77483e69c9

Comment by Michael Smith [ 03/Apr/22 ]

This still occurs in mongo 5.0.6, and we did not encounter it in 3.x or 4.x. We have a monitoring script that runs every couple of minutes to check:

mongo -u ... -p ... --authenticationDatabase admin --quiet --eval 'rs.status().myState'

This should return "1", but occasionally outputs something like:

{"t":{"$date":"2022-04-03T14:30:06.329Z"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":false}}}
1

I can reproduce it by running it a couple hundred times or less in a loop.

I thought about trying mongosh, but the long startup time makes me think it's not intended for scripted use:

$ time mongo -u ... -p ... --authenticationDatabase admin --quiet --eval 'rs.status().myState'
1
 
 
real	0m0.107s
user	0m0.091s
sys	0m0.015s
 
time mongosh -u ... -p ... --authenticationDatabase admin --quiet --eval 'rs.status().myState'
1
 
 
real	0m3.925s
user	0m2.888s
sys	0m0.164s

Comment by Brooke Miller [ 02/Nov/21 ]

We've re-assigned this to the Shell Team to get feedback on the appropriate next steps here.

Comment by Ratika Gandhi [ 25/Oct/21 ]

Passing it to STM because they own the epic for maintaining the old shell. 

Comment by Eric Sedor [ 20/Oct/21 ]

Thanks wernfried.domscheit@sunrise.net, I can reproduce this using the following (with a 5.0.3 mongos running on port 27017):

bash-3.2$ touch noop.js
bash-3.2$ mongo noop.js
MongoDB shell version v5.0.3
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("dd90f39a-4bbe-4e8f-b07d-c752773b066c") }
MongoDB server version: 5.0.3
bash-3.2$ for i in {1..100}; do mongo --quiet noop.js;done
{"t":{"$date":"2021-10-20T18:20:14.538Z"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":false}}}
{"t":{"$date":"2021-10-20T18:20:25.866Z"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":false}}}
bash-3.2$

This seems to occur a few times out of 100 on 5.0.3, but not at all on 4.4.9

This seems related to SERVER-46636 or could be a subset of SERVER-3492, but I am not yet certain.

Comment by Wernfried Domscheit [ 19/Oct/21 ]

The message appears directly when it connects to the MongoDB, before any command is executed.

 

 

Comment by Eric Sedor [ 18/Oct/21 ]

Thanks wernfried.domscheit@sunrise.net,

First, mongosh is under active development and is significantly more likely to receive bug fixes and improvements. Whereas the mongo shell is deprecated. I'd recommend starting to make use of mongosh as soon as you reasonably can.

That said, I'm not able to readily reproduce seeing that message on connection in the mongo shell version 5.0.3. Possibly it is a result of something within the script you're running. Are you able to identify a command within your script that is producing that output?

Comment by Wernfried Domscheit [ 14/Oct/21 ]

Hi Eric

Yes, I run a script in classic mongo shell, the message is printed on standard output. The new mongosh is not working, so it is no option to use it.

MongoDB shell version v5.0.3
MongoDB server version: 5.0.3

Wernfried

 

Comment by Eric Sedor [ 12/Oct/21 ]

Hi wernfried.domscheit@sunrise.net, it sounds like from your description of a script that you are using either the mongo or mongosh shell, is that right? And that this message is being thrown into the output of that script?

Can you clarify which shell and which shell version you're seeing this message on?

Eric

Generated at Thu Feb 08 05:50:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.