I tried mongo replica sets for the first time.
I am using ubuntu on ec2 and I booted up three instances. I used the private IP address of each of the instances. I p
I am just adding this answer for an awkward situation from DB provider.
what happened in our case is the primary and secondary db shifted reversely (primary to secondary and vice versa) and we are getting the same error.
so please check in the configuration settings for database status which may help you.