MongoDB

92 views
Skip to first unread message

José Ricardo Borba

unread,
May 6, 2015, 8:38:56 AM5/6/15
to web...@googlegroups.com
I'm very busy in these days, but I tried to start a new "installation" from the ground (to test the TIME issue with Mongodb in pydal #170), but even without this correction (i.e, with plain web2py clone from github) I receive the below error message.

I'm simply copy the application folder to the new installation (side-by-side with welcome and examples). With CLI client (mongo) everything works fine.

The welcome app works fine.

I see that pydal tries to connect 5 times. The string to connect to mongo is fine (since is a local install. In production will have an user and a password too...).

Version

web2py™ Version 2.10.4-stable+timestamp.2015.04.26.09.05.21

Traceback

Traceback (most recent call last):
File "/home/mydir/w2p210b/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/home/mydir/w2p210b/applications/rastreamento/models/db.py", line 12, in <module>
db = DAL('mongodb://localhost/telemet', pool_size=0, lazy_tables=True)
File "/home/mydir/w2p210b/gluon/packages/dal/pydal/base.py", line 174, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
File "/mydir/w2p210b/gluon/packages/dal/pydal/base.py", line 459, in __init__
raise RuntimeError("Failure to connect, tried %d times:\n%s" % (attempts, tb))
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
File "/home/mydir/w2p210b/gluon/packages/dal/pydal/base.py", line 437, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File "/home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/base.py", line 57, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
File "/home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/mongo.py", line 58, in __init__
from pymongo.write_concern import WriteConcern
File "/home/mydir/w2p210b/gluon/custom_import.py", line 108, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named write_concern



Best regards,
--
José Ricardo Borba

Paolo Valleri

unread,
May 7, 2015, 8:05:52 AM5/7/15
to web...@googlegroups.com
You should use pymongo 3.0

José Ricardo Borba

unread,
May 7, 2015, 3:14:39 PM5/7/15
to web...@googlegroups.com
Allright!

Updating pymongo to version 3.0 solves this up!

Now I take care of the mongo time / pydal issue!

Thanks a lot.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
José Ricardo Borba

Paolo Valleri

unread,
May 7, 2015, 3:26:20 PM5/7/15
to web...@googlegroups.com
update your local copy of pydal, there are several updates regarding mongo in master branch


 Paolo

You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/3q5CfUSPQ1o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

José Ricardo Borba

unread,
May 7, 2015, 3:43:49 PM5/7/15
to web...@googlegroups.com
Yes, I did!
Thanks for the advice.

But submodule when cloning web2py still doesn't work.

Best regards,
Reply all
Reply to author
Forward
0 new messages