Mongo shell hangs after connection

Hi,

I’m trying to run the mongo shell from inside a container. It appears the shell connects then hangs prior to providing a command prompt.

The mongo shell works from outside the container on the docker host. Inside the container I can telnet to the server’s mongo port. I’ve also verified in the server logs that the mongo shell is indeed connecting.

The docker host OS version and docker version:

$ cat /etc/issue
Ubuntu 20.04.3 LTS \n \l
$ docker --version
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

Running the shell from the container (which is the standard mongo 4.4 image):

$ docker run -it mongo:4.4 bash
root@66206820e362:/# telnet 10.140.75.112 27017
Trying 10.140.75.112...
Connected to 10.140.75.112.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
# mongo --verbose mongodb://10.140.75.112:27017
{"t":{"$date":"2022-01-27T18:52:52.237Z"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2022-01-27T18:52:52.237Z"},"s":"D1", "c":"EXECUTOR", "id":23104,   "ctx":"OCSPManagerHTTP-0","msg":"Starting thread","attr":{"threadName":"OCSPManagerHTTP-0","poolName":"OCSPManagerHTTP"}}
MongoDB shell version v4.4.11
connecting to: mongodb://10.140.75.112:27017/?compressors=disabled&gssapiServiceName=mongodb
{"t":{"$date":"2022-01-27T18:52:52.275Z"},"s":"D1", "c":"NETWORK",  "id":20109,   "ctx":"js","msg":"Creating new connection","attr":{"hostAndPort":"10.140.75.112:27017"}}
{"t":{"$date":"2022-01-27T18:52:52.747Z"},"s":"D1", "c":"NETWORK",  "id":20119,   "ctx":"js","msg":"Connected to host","attr":{"connString":"10.140.75.112:27017"}}
{"t":{"$date":"2022-01-27T18:52:53.259Z"},"s":"D1", "c":"NETWORK",  "id":20110,   "ctx":"js","msg":"Connected connection!"}
Implicit session: session { "id" : UUID("3b6c60b9-2f61-46a0-b24b-82503011bac2") }

The mongo shell just hangs at that point.

The server version is 4.4.6. Here is the log message from the client logon:

{"t":{"$date":"2022-01-27T19:04:02.041+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"10.10.10.247:50888","connectionId":2750,"connectionCount":48}}
{"t":{"$date":"2022-01-27T19:04:02.046+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn2750","msg":"client metadata","attr":{"remote":"10.10.10.247:50888","client":"conn2750","doc":{"application":{"name":"MongoDB Shell"},"driver":{"name":"MongoDB Internal Client","version":"4.4.11"},"os":{"type":"Linux","name":"Ubuntu","architecture":"x86_64","version":"20.04"}}}}

Thanks,
Marty