how to solve pymongo.errors.AutoReconnect: could not find master/primary

HowToProgramming

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.

Previous
Error installing mysql-python package
Next
How to switch to different python version on apache mod_wsgi

Leave a Reply

%d bloggers like this: