• Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • None
    • Environment:
      MongoDB 3.4

      Trying to run replica set step down command on version 3.4 MongoDB and keep getting the following error:

       

      connection(mongodb-integration-skaffold-mongodb-replicaset-0.mongodb-integration-skaffold-mongodb-replicaset.mongodb-integration.svc.cluster.local:27017[-16]) unable to decode message length: EOF"

      Here's the code:

       

       
      
      // When you set the readpreference to primary it will run the command on the primary. adminDb := rsClient.Database("admin") 
       stepDownCmd := bson.D{{"replSetStepDown", 60}, {"force", false}} result := adminDb.RunCommand(context.TODO(), stepDownCmd, options.RunCmd().SetReadPreference(readpref.Primary())) 
       if result.Err() != nil { return fmt.Errorf("could not step down primary: %s", result.Err())  } 

       

      I see these "unable to decode message length" errors quite a bit. Is there a good way to debug them?

       

      I'm trying to follow what's in the tests, but seems I'm doing something unfortunate:

       

      https://github.com/mongodb/mongo-go-driver/blob/eb2c1c4315fb6cca5ed9189e5c56e258c05c7630/mongo/integration/primary_stepdown_test.go#L66-L70

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            fbyrne Fulton Byrne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: