#9470 closed defect (worksforme)
AttributeError: 'NoneType' object has no attribute 'rollback'
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | database backend | Version: | 0.12 |
Severity: | major | Keywords: | transaction TracSqlHelper |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I'm getting following error while trying to upgrade my DB.
That's happend after installing TH:ComponentDependencyPlugin
Traceback is:
2010-06-29 15:02:07,642 Trac[console] ERROR: Exception in trac-admin command: Traceback (most recent call last): File "build/bdist.linux-i686/egg/trac/admin/console.py", line 107, in onecmd rv = cmd.Cmd.onecmd(self, line) or 0 File "/usr/lib/python2.6/cmd.py", line 218, in onecmd return self.default(line) File "build/bdist.linux-i686/egg/trac/admin/console.py", line 257, in default return cmd_mgr.execute_command(*args) File "build/bdist.linux-i686/egg/trac/admin/api.py", line 123, in execute_command return f(*fargs) File "build/bdist.linux-i686/egg/trac/env.py", line 790, in _do_upgrade self.env.upgrade(backup=no_backup is None) File "build/bdist.linux-i686/egg/trac/env.py", line 533, in upgrade with_transaction(self)(participant.upgrade_environment) File "build/bdist.linux-i686/egg/trac/db/api.py", line 82, in transaction_wrapper ldb.rollback() File "build/bdist.linux-i686/egg/trac/db/util.py", line 102, in __getattr__ return getattr(self.cnx, name) AttributeError: 'NoneType' object has no attribute 'rollback'
Attachments (0)
Change History (11)
comment:1 by , 14 years ago
Component: | general → database backend |
---|---|
Description: | modified (diff) |
Keywords: | transaction added |
comment:5 by , 14 years ago
I can reproduce the problem if I do an explicit db.close()
from within an upgrade_environment(self, db)
method, which normally shouldn't happen.
The plugin in question doesn't even use db
in that method. Are you using some other plugins?
comment:6 by , 14 years ago
Yes, I'm using TH:TracHoursPlugin with all it's dependences (feedparser-4.1, python-dateutil-1.4.1, SilverCity-0.9.7, tracsqlhelper, TH:TicketSidebarProviderPlugin)
comment:7 by , 14 years ago
Acually I've installed TH:ComponentDependencyPlugin to get work TH:TracHoursPlugin. And SetupTracHours component of TracHoursPlugin require DB upgrade.
2010-06-29 15:02:07,629 Trac[env] WARNING: Component <trachours.setup.SetupTracHours object at 0xabe302c> requires environment upgrade
comment:8 by , 14 years ago
Keywords: | TracSqlHelper added |
---|---|
Milestone: | 0.12.1 |
Resolution: | → worksforme |
Status: | new → closed |
Looks like this was caused by TH:TracSqlHelper, see #TH7262.
comment:11 by , 14 years ago
Replying to cboos:
I'd like to, but as is, it breaks the tests.
Because the tests rely on re-using a single global DatabaseManager, regardless of the actual environment used, so one possible fix would be to preset the per environment DatabaseManager instance to this global one… Not sure it's worth the additional complexity in EnvironmentStub.
Interesting. I forgot to do one change after r9442:
trac/db/api.py
env.get_db_cnx()However, this omission should have been harmless. Need to investigate further.