#1535 closed defect (fixed)
trac-admin upgrade doesn't work in python 2.2
Reported by: | xris | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | admin/console | Version: | devel |
Severity: | blocker | Keywords: | |
Cc: | tiger@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
trying to upgrade past [1585] or so with python 2.2.. when I reach the point that I need to do a db upgrade, I get:
# trac-admin /var/www/trac/data/ upgrade Upgrade failed: maximum recursion depth exceeded Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/trac/scripts/admin.py", line 1018, in do_upgrade curr = self.__env.get_version() File "/usr/lib/python2.2/site-packages/trac/env.py", line 180, in get_version cursor = cnx.cursor() File "/usr/lib/python2.2/site-packages/trac/db.py", line 70, in cursor cursor = self.cnx.cursor() File "/usr/lib/python2.2/site-packages/trac/db.py", line 67, in __getattr__ return getattr(self.cnx, name) File "/usr/lib/python2.2/site-packages/trac/db.py", line 67, in __getattr__ <<<snip>>> File "/usr/lib/python2.2/site-packages/trac/db.py", line 67, in __getattr__ return getattr(self.cnx, name) File "/usr/lib/python2.2/site-packages/trac/db.py", line 67, in __getattr__ Traceback (most recent call last): File "/usr/bin/trac-admin", line 27, in ? run(*sys.argv[1:]) File "/usr/lib/python2.2/site-packages/trac/scripts/admin.py", line 1075, in run tracadm.docmd(command) File "/usr/lib/python2.2/site-packages/trac/scripts/admin.py", line 65, in docmd self.onecmd(cmd) File "/usr/lib/python2.2/cmd.py", line 200, in onecmd return func(arg) File "/usr/lib/python2.2/site-packages/trac/scripts/admin.py", line 1033, in do_upgrade traceback.print_exc() File "/usr/lib/python2.2/traceback.py", line 210, in print_exc print_exception(etype, value, tb, limit, file) File "/usr/lib/python2.2/traceback.py", line 123, in print_exception print_tb(tb, limit, file) File "/usr/lib/python2.2/traceback.py", line 67, in print_tb ' File "%s", line %d, in %s' % (filename,lineno,name)) File "/usr/lib/python2.2/traceback.py", line 13, in _print file.write(str+terminator)
Attachments (0)
Change History (12)
comment:1 by , 20 years ago
Priority: | normal → high |
---|---|
Severity: | normal → blocker |
comment:2 by , 20 years ago
Milestone: | → 0.9 |
---|---|
Owner: | changed from | to
comment:3 by , 20 years ago
Cc: | added |
---|
I rolled back my installation to last working revision [1585].
comment:4 by , 20 years ago
from IRC yesterday, in case someone else wants to look at this:
(10:29:27) matt_good: __getattr__ is a special function in Python that is used to look up attributes of an object (10:29:53) matt_good: but the part "self.cnx" is also calling __getattr__ to look up "cnx" (10:30:05) matt_good: so it just recurses
comment:5 by , 20 years ago
Well, I was a bit confused when I saw that at first. Actually __getattr__
is only called if the attribute isn't actually set on the object. In this case self.cnx
is set in the contructor, so the fact that __getattr__
is being called recursively is a sign that the cnx has somehow been deleted from the object. I'm still not sure why this is happening (and unfortunately I haven't gotten SVN bindings installed for Python 2.2, so I haven't been able to reproduce this).
comment:6 by , 19 years ago
Well, I just went and applied all of the db updates manually, hoping that it'd get things to work.. Unfortunately, once the db updates apply (some with errors about them already being applied), trac still won't run:
Trac detected an internal error: maximum recursion depth exceeded Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/trac/web/cgi_frontend.py", line 103, in run dispatch_request(os.getenv('PATH_INFO', ''), req, env) File "/usr/lib/python2.2/site-packages/trac/web/main.py", line 393, in dispatch_request authenticator = Authenticator(db, req, check_ip) File "/usr/lib/python2.2/site-packages/trac/web/auth.py", line 49, in __init__ cursor = db.cursor() File "/usr/lib/python2.2/site-packages/trac/db.py", line 70, in cursor return IterableCursor(self.cnx.cursor()) File "/usr/lib/python2.2/site-packages/trac/db.py", line 67, in __getattr__ return getattr(self.cnx, name) File "/usr/lib/python2.2/site-packages/trac/db.py", line 67, in __getattr__ return getattr(self.cnx, name) ... and so on and so forth into oblivion
comment:7 by , 19 years ago
cmlenz seems to have fixed the "upgrade" problem, but now there are other issues:
Traceback (innermost last): File "csparse.c", line 293, in cs_parse_file() File "neo_hdf.c", line 1896, in hdf_search_path() NotFoundError: Path report.cs not found Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/trac/web/cgi_frontend.py", line 103, in run dispatch_request(os.getenv('PATH_INFO', ''), req, env) File "/usr/lib/python2.2/site-packages/trac/web/main.py", line 421, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.2/site-packages/trac/web/main.py", line 291, in dispatch req.display(template, content_type or 'text/html') File "/usr/lib/python2.2/site-packages/trac/web/main.py", line 152, in display data = self.hdf.render(template) File "/usr/lib/python2.2/site-packages/trac/web/clearsilver.py", line 260, in render template.parseFile(filename) Error: Traceback (innermost last): File "csparse.c", line 293, in cs_parse_file() File "neo_hdf.c", line 1896, in hdf_search_path() NotFoundError: Path report.cs not found
And on request from cmlenz in irc:
hdf { loadpaths = ['/var/trac/web/templates', '/usr/share/trac/templates'] }
comment:8 by , 19 years ago
I've tried to do upgrade from [1585] to [1826]. Below errors I've got.
[tiger@bingo repos]$ sudo -u apache trac-admin ./ upgrade Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0xa1bd15c>> ignored Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0xa20f13c>> ignored Upgrade: Upgrading /var/repo/trac/poker to db version 13 Upgrade: Backup of old database saved in /var/repo/trac/poker/db/trac.db.10.bak Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0xa20f9e4>> ignored Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0xa1d833c>> ignored Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0xa2214c4>> ignored
This errors I've got accessing my Trac from the browser:
Oops... Trac detected an internal error: Traceback (innermost last): File "csparse.c", line 293, in cs_parse_file() File "neo_hdf.c", line 1896, in hdf_search_path() NotFoundError: Path wiki.cs not found Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/trac/web/cgi_frontend.py", line 103, in run dispatch_request(os.getenv('PATH_INFO', ''), req, env) File "/usr/lib/python2.2/site-packages/trac/web/main.py", line 421, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.2/site-packages/trac/web/main.py", line 291, in dispatch req.display(template, content_type or 'text/html') File "/usr/lib/python2.2/site-packages/trac/web/main.py", line 152, in display data = self.hdf.render(template) File "/usr/lib/python2.2/site-packages/trac/web/clearsilver.py", line 260, in render template.parseFile(filename) Error: Traceback (innermost last): File "csparse.c", line 293, in cs_parse_file() File "neo_hdf.c", line 1896, in hdf_search_path() NotFoundError: Path wiki.cs not found
comment:9 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This latter error is fixed in [1845].
comment:10 by , 19 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I've tried [1845]. But still have following errors while upgrading db. Are they actually only related to python 2.2?
[tiger@bingo repos]$ sudo -u apache trac-admin ./ upgrade Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0x983ab24>> ignored Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0x989335c>> ignored Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0x9894d4c>> ignored Exception exceptions.AttributeError: "type object 'object' has no attribute '__getattr__'" in <bound method PooledConnection.__del__ of <trac.db.PooledConnection object at 0x9892c34>> ignored
comment:11 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Those are just warnings and not really related to this ticket. The main two issues raised here are fixed.
comment:12 by , 19 years ago
I'm not agree to you in the one point. I confirm that as soon as I upgraded server to python 2.3 (at last) everything become smooth. So I have to outline that currently project is incompatible with python 2.2.
I confirm issue on r1696. Can't perform trac-admin upgrade. trac-admin response is "Upgrade failed: maximum recursion depth exceeded"
Python 2.2.3