Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-39649

network error while attempting to run command 'buildinfo' on host xx.yy.zz

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.3
    • Component/s: Shell
    • Labels:
      None
    • ALL
    • Hide

      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

      ```

       

       

       

      Show
      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 ``` mongod.conf for documentation of all options, see: http://docs.mongodb.org/manual/reference/configuration-options/ 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 engine: mmapv1: wiredTiger: processManagement: fork: true # fork and run in background pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile timeZoneInfo: /usr/share/zoneinfo 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: Enterprise-Only Options ```      

      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.

       

       

       

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            shi-xiaopeng Shi Xiaopeng
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: