'Mongo' object has no attribute 'server_version_major

84 views
Skip to first unread message

YLa

unread,
Dec 28, 2019, 3:53:36 AM12/28/19
to web2py-users
Hi Massimo,

I am seeing: 'Mongo' object has no attribute 'server_version_major'"

S'Traceback (most recent call last):\n  File "/opt/python/current/app/gluon/restricted.py", line 219, in restricted\n    exec(ccode, environment)\n  File "/opt/python/bundle/2/app/applications/beengo/models/db.py", line 42, in <module>\n    session.connect(request, response, db, masterapp=None)\n  File "/opt/python/current/app/gluon/globals.py", line 965, in connect\n    row = table(record_id, unique_key=unique_key)\n  File "/opt/python/run/venv/local/lib/python2.7/site-packages/pydal/objects.py", line 703, in __call__\n    orderby_on_limitby=False,\n  File "/opt/python/run/venv/local/lib/python2.7/site-packages/pydal/objects.py", line 2634, in select\n    return adapter.select(self.query, fields, attributes)\n  File "/opt/python/run/venv/local/lib/python2.7/site-packages/pydal/adapters/mongo.py", line 242, in select\n    return self.__select(query, fields, **attributes)\n  File "/opt/python/run/venv/local/lib/python2.7/site-packages/pydal/adapters/mongo.py", line 383, in __select\n    if self.server_version_major < 2.6:\nAttributeError: \'Mongo\' object has no attribute \'server_version_major\'\n'


any help would be greatly appreciated.


Thanks

Massimo Di Pierro

unread,
Dec 28, 2019, 3:58:27 AM12/28/19
to web2py-users
Can you provide an example to reproduce?
It seems to run the mongo tests fine on travis:

Dmitrii Ermolaev

unread,
Aug 18, 2021, 1:25:00 AM8/18/21
to web2py-users
I install mongo-org from:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

connection:
db.uri = mongodb://localhost/ipay

BUT when I open DB admin panel (appadmin/select/db?query=db.currs.id>0):

 Traceback (most recent call last): File "/home/www-data/web2py/applications/7pay_in/controllers/appadmin.py", line 264, in select rows = db(query, ignore_common_filters=True).select( File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 2649, in select return adapter.select(self.query, fields, attributes) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/mongo.py", line 242, in select return self.__select(query, fields, **attributes) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/mongo.py", line 383, in __select if self.server_version_major < 2.6: AttributeError: 'Mongo' object has no attribute 'server_version_major'




суббота, 28 декабря 2019 г. в 11:58:27 UTC+3, Massimo Di Pierro:

Dmitrii Ermolaev

unread,
Aug 18, 2021, 1:32:00 AM8/18/21
to web2py-users
2.21.1-stable+timestamp.2020.11.28.04.10.44
(Running on nginx/1.18.0, Python 3.8.10)

суббота, 28 декабря 2019 г. в 11:58:27 UTC+3, Massimo Di Pierro:
Can you provide an example to reproduce?

Dmitrii Ermolaev

unread,
Aug 18, 2021, 2:04:48 AM8/18/21
to web2py-users
I delete reload all modules by https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu-focal.sh

and all was WORK! 

среда, 18 августа 2021 г. в 08:32:00 UTC+3, Dmitrii Ermolaev:

Dmitrii Ermolaev

unread,
Aug 18, 2021, 2:11:40 AM8/18/21
to web2py-users
no (( I see error anew in some cases:

Traceback (most recent call last):
File "/home/www-data/web2py/gluon/html.py", line 1903, in _validate
(value, errors) = validator(value)
File "/home/www-data/web2py/gluon/packages/dal/pydal/validators.py", line 159, in __call__
return self.validate(value, record_id), None
File "/home/www-data/web2py/gluon/packages/dal/pydal/validators.py", line 806, in validate
if subset.select(limitby=(0, 1)):
File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 2649, in select
return adapter.select(self.query, fields, attributes)
File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/mongo.py", line 242, in select
return self.__select(query, fields, **attributes)
File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/mongo.py", line 383, in __select
if self.server_version_major < 2.6:
AttributeError: 'Mongo' object has no attribute 'server_version_major'

среда, 18 августа 2021 г. в 09:04:48 UTC+3, Dmitrii Ermolaev:
Reply all
Reply to author
Forward
0 new messages