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.
1 Comment
Hi there…
try :
$mkdir -p /data/db
then you shoud call it manually doing
$sudo mongodb
cheers