how to solve pymongo.errors.AutoReconnect: could not find master/primary
If you are coding and you have experienced an error like:
pymongo.errors.AutoReconnect: could not find master/primary
The problem is that your mongodb instance has not been shutdown correctly last time. To solve this just run the following command (it has been tested on a Ubuntu server):
sudo rm /var/lib/mongodb/mongod.lock && sudo /etc/init.d/mongodb restart
Hope this helps. I had to type that a lot of time during my coding time indeed.