[SERVER-39649] network error while attempting to run command 'buildinfo' on host xx.yy.zz Created: 18/Feb/19  Updated: 10/Apr/19  Resolved: 08/Mar/19

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

Type: Bug Priority: Major - P3
Reporter: Shi Xiaopeng Assignee: Eric Sedor
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

mongo mongodb://xx.yy.zzz:27017

error message:

```

MongoDB shell version v4.0.3
connecting to: mongodb://xx.yy.zzz:27017
Implicit session: session { "id" : UUID("2d604559-9a96-43f8-8f1b-a7f3de383601") }
2019-02-18T15:23:00.403+0800 E QUERY [js] Error: error doing query: failed: network error while attempting to run command 'buildinfo' on host 'xx.yy.zzz:27017' :
DB.prototype.runCommand@src/mongo/shell/db.js:168:1
DB.prototype.adminCommand@src/mongo/shell/db.js:186:16
DB.prototype.serverBuildInfo@src/mongo/shell/db.js:1275:16
DB.prototype.version@src/mongo/shell/db.js:1327:16
connect@src/mongo/shell/mongo.js:277:29
@(connect):1:6
2019-02-18T15:23:00.407+0800 I NETWORK [js] trying reconnect to xx.yy.zzz:27017 failed
2019-02-18T15:23:00.473+0800 I NETWORK [js] reconnect xx.yy.zzz:27017 ok
exception: connect failed

```

mongod.conf

```

  1. mongod.conf
  1. for documentation of all options, see:
  2. http://docs.mongodb.org/manual/reference/configuration-options/
  1. where to write logging data.
    systemLog:
    destination: file
    logAppend: true
    path: /var/log/mongodb/mongod.logWhere and how to store data.
    storage:
       dbPath: /var/lib/mongo
       journal:
         enabled: true
  2. engine:
  3. mmapv1:
  4. wiredTiger:

processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo

  1. network interfaces
    net:
    port: 27017
    bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.

security:
authorization: 'enabled'

#operationProfiling:

#replication:

#sharding:

    1. Enterprise-Only Options

```

 

 

 

Participants:

 Description   

It often fails when getting data from remote mongo server recently, I try to connect the server on my local machine, it failed.

I searched the web, and i found [https://stackoverflow.com/questions/35509937/mongo-network-error-while-attempting-to-run-command-whatsmyuri-on-host]

I got some hint on mongo shell version difference, but it's my case, both mongo shell  and mongod version is v4.0.3

Then I found this one 35370, but it still not my case.

 

 

 



 Comments   
Comment by donghua liu [ 10/Apr/19 ]

I have the same problem, when I connect my mongodb on ubuntu from Windows, I got the following errors.

C:\Users\Liu.D.H>mongo 113.55.14.114
MongoDB shell version v4.0.8
connecting to: mongodb://113.55.14.114:27017/test?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("b84061bf-e308-47f7-b59f-6c2940ba450d") }
2019-04-10T08:55:12.522+0800 E QUERY [js] Error: error doing query: failed: network error while attempting to run command 'buildinfo' on host '113.55.14.114:27017' :
DB.prototype.runCommand@src/mongo/shell/db.js:168:1
DB.prototype.adminCommand@src/mongo/shell/db.js:186:16
DB.prototype.serverBuildInfo@src/mongo/shell/db.js:1275:16
DB.prototype.version@src/mongo/shell/db.js:1327:16
connect@src/mongo/shell/mongo.js:363:29
@(connect):2:6
2019-04-10T08:55:12.526+0800 I NETWORK [js] trying reconnect to 113.55.14.114:27017 failed
2019-04-10T08:55:12.529+0800 I NETWORK [js] reconnect 113.55.14.114:27017 ok
exception: connect failed
 
C:\Users\Liu.D.H>

The related logs of the server was the followings.

2019-04-09T20:55:09.170-0400 I NETWORK [listener] connection accepted from 113.55.127.140:3455 #3014 (1 connection now open)
2019-04-09T20:55:09.171-0400 I NETWORK [conn3014] received client metadata from 113.55.127.140:3455 conn3014: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.8" }, os: { type: "Windows", name: "Microsoft Windows 10", architecture: "x86_64", version: "10.0 (build 17763)" } }
2019-04-09T20:55:09.176-0400 I NETWORK [conn3014] end connection 113.55.127.140:3455 (0 connections now open)
2019-04-09T20:55:09.182-0400 I NETWORK [listener] connection accepted from 113.55.127.140:3456 #3015 (1 connection now open)
2019-04-09T20:55:09.182-0400 I NETWORK [conn3015] received client metadata from 113.55.127.140:3456 conn3015: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.8" }, os: { type: "Windows", name: "Microsoft Windows 10", architecture: "x86_64", version: "10.0 (build 17763)" } }
2019-04-09T20:55:09.184-0400 I NETWORK [conn3015] end connection 113.55.127.140:3456 (0 connections now open)

 

I can confirm that both the client and the server use the same latest version 4.0.8, If I tried to connect from linux to linux, then it's ok.

Comment by Eric Sedor [ 08/Mar/19 ]

Hi,

We haven’t heard back from you for some time, so I’m going to mark this ticket as resolved. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Regards,
Eric

Comment by Eric Sedor [ 20/Feb/19 ]

Hello, can you provide the server (mongod) logs during these connection attempts?

Can you also clarify: Does the shell reconnect and lose connection again? If so, how long between each connection and disconnection?

Generated at Thu Feb 08 04:52:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.