[SERVER-48562] mongo client Created: 03/Jun/20  Updated: 12/Aug/21  Resolved: 12/Aug/21

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

Type: Question Priority: Major - P3
Reporter: Lizhu you Assignee: Edwin Zhou
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Hi 
   I connet a mongo replicaSet which achieve port-mapping by mongo string url

xx.xx.xx.xx 233 -> mongoIp mongoPort

 

mongo mongodb://[username]:[password]@xx.xx.xx.xx:233/admin?replicaSet=foobar 
 
It print below content:
...
2020-06-03T10:42:50.110+0800 I NETWORK  [js] Successfully connected to 139.198.11.141:27777 (1 connections now open to xx.xx.xx.xx:233 with a 5 second timeout)
2020-06-03T10:42:50.111+0800 I NETWORK  [js] changing hosts to foobar/[mongoIp]:[mongoPort] from foobar/xx.xx.xx.xx:233
...
 
how to disable print this content?
2020-06-03T10:42:50.111+0800 I NETWORK [js] changing hosts to foobar/[mongoIp]:[mongoPort] from foobar/xx.xx.xx.xx:233

 

 

 

 



 Comments   
Comment by Edwin Zhou [ 12/Aug/21 ]

Hi 2541058309@qq.com,

Thanks for your report. Please note that the SERVER project is for bugs for the MongoDB server. Based on the second comment from hungfei.ding@gmail.com, this ticket does not appear to be a bug with the server, but instead with your network environment so I will now close it. If you need further assistance troubleshooting, I encourage you to ask our community by posting on the MongoDB Developer Community Forums.

Best,
Edwin

Comment by Ryan Chipman [ 09/Jul/20 ]

dmitry.agranat the old shell is maintained by the server team, and I am not a server engineer. This should be assigned to a server engineer, not to me.

Comment by Ryan Chipman [ 07/Jul/20 ]

dmitry.agranat a server engineer might be better suited to look into this than I am – the shell isn't maintained by the tools team

Comment by Chen Xudong [ 10/Jun/20 ]

client log:

root@i-3eup0x3p:~/mongodb-linux-x86_64-ubuntu1804-4.0.18/bin# ./mongo --verbose

mongodb://root:123321@139.198.188.48:63151/admin?replicaSet=foobar MongoDB shell version v4.0.18

connecting to: mongodb://139.198.188.48:63151/admin?gssapiServiceName=mongodb&replicaSet=foobar

2020-06-02T20:42:30.416+0000 D NETWORK [js] Starting up task executor for monitoring replica sets in response to request to monitor set: foobar/139.198.188.48:63151

2020-06-02T20:42:30.416+0000 I NETWORK [js] Starting new replica set monitor for foobar/139.198.188.48:63151

2020-06-02T20:42:30.416+0000 D NETWORK [js] creating new connection to:139.198.188.48:63151

2020-06-02T20:42:30.452+0000 D NETWORK [js] connected to server 139.198.188.48:63151

2020-06-02T20:42:30.488+0000 D NETWORK [js] connected connection!

2020-06-02T20:42:30.488+0000 I NETWORK [js] Successfully connected to 139.198.188.48:63151 (1 connections now open to 139.198.188.48:63151 with a 5 second timeout)

2020-06-02T20:42:30.525+0000 I NETWORK [js] changing hosts to foobar/192.168.0.4:32765 from foobar/139.198.188.48:63151 2020-06-02T20:42:30.525+0000 D NETWORK [js] creating new connection to:192.168.0.4:32765

2020-06-02T20:42:35.530+0000 D - [js] User Assertion: Location40356: connection pool: connect failed 192.168.0.4:32765 : couldn't connect to server 192.168.0.4:32765, connection attempt failed: SocketException: Error connecting to 192.168.0.4:32765 :: caused by :: Connection timed out src/mongo/client/connpool.cpp 399

2020-06-02T20:42:35.531+0000 D NETWORK [ReplicaSetMonitor-TaskExecutor] Refreshing replica set foobar took 5114 msec

2020-06-02T20:42:36.031+0000 D NETWORK [js] creating new connection to:192.168.0.4:32765

2020-06-02T20:42:41.036+0000 D - [js] User Assertion: Location40356: connection pool: connect failed 192.168.0.4:32765 : couldn't connect to server 192.168.0.4:32765, connection attempt failed: SocketException: Error connecting to 192.168.0.4:32765 :: caused by :: Connection timed out src/mongo/client/connpool.cpp 399

2020-06-02T20:42:41.036+0000 W NETWORK [js] Unable to reach primary for set foobar

2020-06-02T20:42:41.036+0000 I NETWORK [js] Cannot reach any nodes for set foobar. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.

2020-06-02T20:42:41.537+0000 D NETWORK [js] creating new connection to:192.168.0.4:32765

2020-06-02T20:42:46.542+0000 D - [js] User Assertion: Location40356: connection pool: connect failed 192.168.0.4:32765 : couldn't connect to server 192.168.0.4:32765, connection attempt failed: SocketException: Error connecting to 192.168.0.4:32765 :: caused by :: Connection timed out src/mongo/client/connpool.cpp 399

2020-06-02T20:42:46.542+0000 W NETWORK [js] Unable to reach primary for set foobar

2020-06-02T20:42:46.542+0000 I NETWORK [js] Cannot reach any nodes for set foobar. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.

2020-06-02T20:42:46.543+0000 D - [js] User Assertion: InternalError: connect failed to replica set

server log:

2020-06-02T20:42:18.773+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55402 #40224 (1 connection now open)
2020-06-02T20:42:18.773+0800 I NETWORK [conn40224] received client metadata from 127.0.0.1:55402 conn40224: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:18.774+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55404 #40225 (2 connections now open)
2020-06-02T20:42:18.774+0800 I NETWORK [conn40225] received client metadata from 127.0.0.1:55404 conn40225: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:18.785+0800 I ACCESS [conn40225] Successfully authenticated as principal qc_master on admin
2020-06-02T20:42:18.788+0800 I NETWORK [conn40224] end connection 127.0.0.1:55402 (1 connection now open)
2020-06-02T20:42:18.788+0800 I NETWORK [conn40225] end connection 127.0.0.1:55404 (0 connections now open)
2020-06-02T20:42:28.952+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55406 #40226 (1 connection now open)
2020-06-02T20:42:28.953+0800 I NETWORK [conn40226] received client metadata from 127.0.0.1:55406 conn40226: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:28.954+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55408 #40227 (2 connections now open)
2020-06-02T20:42:28.954+0800 I NETWORK [conn40227] received client metadata from 127.0.0.1:55408 conn40227: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:28.965+0800 I ACCESS [conn40227] Successfully authenticated as principal qc_master on admin
2020-06-02T20:42:28.967+0800 I NETWORK [conn40226] end connection 127.0.0.1:55406 (1 connection now open)
2020-06-02T20:42:28.967+0800 I NETWORK [conn40227] end connection 127.0.0.1:55408 (0 connections now open)
2020-06-02T20:42:38.927+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55410 #40228 (1 connection now open)
2020-06-02T20:42:38.927+0800 I NETWORK [conn40228] received client metadata from 127.0.0.1:55410 conn40228: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:38.928+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55412 #40229 (2 connections now open)
2020-06-02T20:42:38.929+0800 I NETWORK [conn40229] received client metadata from 127.0.0.1:55412 conn40229: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:38.939+0800 I ACCESS [conn40229] Successfully authenticated as principal qc_master on admin
2020-06-02T20:42:38.941+0800 I NETWORK [conn40228] end connection 127.0.0.1:55410 (1 connection now open)
2020-06-02T20:42:38.941+0800 I NETWORK [conn40229] end connection 127.0.0.1:55412 (0 connections now open)
2020-06-02T20:42:48.909+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55414 #40230 (1 connection now open)
2020-06-02T20:42:48.909+0800 I NETWORK [conn40230] received client metadata from 127.0.0.1:55414 conn40230: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:48.910+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55416 #40231 (2 connections now open)
2020-06-02T20:42:48.910+0800 I NETWORK [conn40231] received client metadata from 127.0.0.1:55416 conn40231: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:48.921+0800 I ACCESS [conn40231] Successfully authenticated as principal qc_master on admin
2020-06-02T20:42:48.923+0800 I NETWORK [conn40230] end connection 127.0.0.1:55414 (1 connection now open)
2020-06-02T20:42:48.923+0800 I NETWORK [conn40231] end connection 127.0.0.1:55416 (0 connections now open)
2020-06-02T20:42:58.596+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55418 #40232 (1 connection now open)
2020-06-02T20:42:58.597+0800 I NETWORK [conn40232] received client metadata from 127.0.0.1:55418 conn40232: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:58.598+0800 I NETWORK [listener] connection accepted from 127.0.0.1:55420 #40233 (2 connections now open)
2020-06-02T20:42:58.598+0800 I NETWORK [conn40233] received client metadata from 127.0.0.1:55420 conn40233: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Ubuntu 16.04 xenial", architecture: "x86_64", version: "4.4.0-131-generic" }, platform: "CPython 2.7.12.final.0" }
2020-06-02T20:42:58.609+0800 I ACCESS [conn40233] Successfully authenticated as principal qc_master on admin
2020-06-02T20:42:58.612+0800 I NETWORK [conn40232] end connection 127.0.0.1:55418 (1 connection now open)
2020-06-02T20:42:58.612+0800 I NETWORK [conn40233] end connection 127.0.0.1:55420 (0 connections now open)

Comment by Carl Champain (Inactive) [ 08/Jun/20 ]

Hi 2541058309@qq.com,

Can you please:

  • Provide the full mongod.log file for this node
  • Clarify what the bug is

Kind regards,
Carl
 

Comment by Hongfei Ding [ 04/Jun/20 ]

want to add some extra points.

 

The issue is not about hiding the logs, but rather, it is that the mongo client failed to connect to a server that is behind a port forwarding setting. Looking at the log, it seems like the server is returning its private network IP to the connecting client and ask for a "host change" reconnection. The reconnection is guaranteed to fail as it is a private network.

 

 

Let me know if it is still unclear.

Comment by Ryan Chipman [ 03/Jun/20 ]

moving to SERVER, since the mongo shell is owned by the server team, not the tools team

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