-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Administrative Commands
-
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: