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

Mongos v3.7.2-387 fails to connect to config server at startup on Windows and Mac

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL

      It appears that mongos cannot connect to config server replica set when mongo-orchestration is starting a sharded cluster without authentication and without SSL.

      I can also reproduce this locally on Mac with mongodb version:

      mongos version v3.7.2-387-g0d53707
      git version: 0d5370783beeb4936a181dd2f69387da4b5e816c
      OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016
      allocator: system
      modules: enterprise
      build environment:
          distarch: x86_64
          target_arch: x86_64
      

      This is the sequence of events:

      1. Mongo-orchestration successfully starts a single member config server replica set on "localhost:1026"
      2. Mongo-orchestration starts a single mongos
      3. mongos fails to connect to the config server:
        2018-03-08T21:35:16.137+0000 W NETWORK  [mongosMain] Unable to reach primary for set 82477b90-45d1-4735-ac9d-716451b6de27
        2018-03-08T21:35:16.137+0000 W SHARDING [mongosMain] Error initializing sharding state, sleeping for 2 seconds and trying again :: caused by :: FailedToSatisfyReadPreference: Error loading clusterID :: caused by :: Could not find host matching read preference { mode: "nearest" } for set 82477b90-45d1-4735-ac9d-716451b6de27
        2018-03-08T21:35:17.637+0000 W NETWORK  [monitoring keys for HMAC] Unable to reach primary for set 82477b90-45d1-4735-ac9d-716451b6de27
        
      4. Indeed the config server never recieves a connection from the mongos. Only connections from mongo-ochestration are present in the config server's log.
      5. Mongo-orchestration fails

      Here's mongos failing to connect to the config server with a log level 5:

      3-09T11:51:39.979-0800 D NETWORK  [monitoring keys for HMAC] Starting new refresh of replica set 561b1476-7e06-4a37-a2e0-5eedfa80d336
      2018-03-09T11:51:39.980-0800 D NETWORK  [monitoring keys for HMAC] creating new connection to:localhost:1026
      2018-03-09T11:51:39.981-0800 D -        [monitoring keys for HMAC] User Assertion: Location40356: connection pool: connect failed localhost:1026 : couldn't connect to server localhost:1026, connection attempt failed: SocketException: Connection refused src/mongo/client/connpool.cpp 394
      2018-03-09T11:51:39.981-0800 W NETWORK  [monitoring keys for HMAC] Unable to reach primary for set 561b1476-7e06-4a37-a2e0-5eedfa80d336
      2018-03-09T11:51:40.049-0800 D NETWORK  [mongosMain] Starting new refresh of replica set 561b1476-7e06-4a37-a2e0-5eedfa80d336
      2018-03-09T11:51:40.049-0800 D NETWORK  [mongosMain] creating new connection to:localhost:1026
      2018-03-09T11:51:40.050-0800 D -        [mongosMain] User Assertion: Location40356: connection pool: connect failed localhost:1026 : couldn't connect to server localhost:1026, connection attempt failed: SocketException: Connection refused src/mongo/client/connpool.cpp 394
      2018-03-09T11:51:40.050-0800 W NETWORK  [mongosMain] Unable to reach primary for set 561b1476-7e06-4a37-a2e0-5eedfa80d336
      2018-03-09T11:51:40.050-0800 I NETWORK  [mongosMain] Cannot reach any nodes for set 561b1476-7e06-4a37-a2e0-5eedfa80d336. Please check network connectivity and the status of the set. This has happened for 141 checks in a row.
      

      For more info see https://github.com/10gen/mongo-orchestration/issues/239

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: