pymongo error when starting app

3 views
Skip to first unread message

Nandy

unread,
Mar 24, 2011, 7:41:25 PM3/24/11
to Whirlwind
hi.
When i try to start an app using "python main.py" i get this error :

ubuntu@ubuntu:~/new$ python main.py
Traceback (most recent call last):
File "main.py", line 7, in <module>
Bootstrap.run()
File "/home/ubuntu/new/bootstrap.py", line 93, in run
bootstrap.main()
File "/home/ubuntu/new/bootstrap.py", line 38, in main
Mongo.create(host=options.db_host, port=options.db_port)
File "/usr/local/lib/python2.6/dist-packages/whirlwind/db/mongo.py",
line 44, in create
db.connection = Connection(kwargs['host'],kwargs['port'])
File "/usr/local/lib/python2.6/dist-packages/mongokit-0.6-py2.6.egg/
mongokit/connection.py", line 52, in __init__
super(Connection, self).__init__(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/pymongo-1.9-py2.6-linux-
i686.egg/pymongo/connection.py", line 305, in __init__
self.__find_master()
File "/usr/local/lib/python2.6/dist-packages/pymongo-1.9-py2.6-linux-
i686.egg/pymongo/connection.py", line 509, in __find_master
raise AutoReconnect("could not find master/primary")
pymongo.errors.AutoReconnect: could not find master/primary


Sorry to bother you and i appreciate your time.

Matt Dennebaum

unread,
Mar 24, 2011, 8:33:23 PM3/24/11
to Whirlwind
Hi Nandy,

No bother at all. This error just means that whirlwind (pymongo more
specifically) can't connect to mongodb. Make sure you have mongodb
running. By default whirlwind assumes your mongodb is running on
localhost. If you want to point it somewhere else you can set a dif
hostname and port via the config/settings.py file. We will work on
adding this to the docs soon.

best,
Matt

Nandy

unread,
Mar 25, 2011, 3:31:18 AM3/25/11
to Whirlwind
Hi Matt,

Thanks for the quick reply. I got it to work.
Reply all
Reply to author
Forward
0 new messages