Opened 2 years ago
Last modified 2 years ago
Hello,
Is there any plan at the moment to update TracHoursPlugin for Trac 0.12 ?
I apologize, but I don't have any time to upgrade this plugin right now. If you have the time and ability to maintain it, I'd welcome it being adopted.
Hi,
I've created a 0.12-compatibility branch and begun committing patches to make this plugin work against 0.12b1.
http://trac-hacks.org/browser/trachoursplugin/0.12 http://trac-hacks.org/svn/trachoursplugin/0.12
After a bit of work, that branch is currently working well for my Trac 0.12b1 installation. I haven't tested it extensively though.
Please try it out and feel free to report any issues you find.
Hi, I've installed latest Trac 0.12 and above mentioned branch... but when I run trac-admin upgrade I get: AttributeError?: 'NoneType?' object has no attribute 'rollback'
Replying to Vasja:
I can reproduce this error. It looks like it might only occur if you enable the "multiproject hours" component of the plugin (I hadn't enabled that earlier, and never saw this error)
After some poking around I see that the exception you gave is masking the real traceback which is:
Traceback (most recent call last): File "/tmp/trachours/0.12/trachours/setup.py", line 53, in upgrade_environment version = self.version() File "/tmp/trachours/0.12/trachours/setup.py", line 68, in version version = get_scalar(self.env, "select value from system where name = 'trachours.db_version';") File "/tmp/trachours/sqlhelper/tracsqlhelper/__init__.py", line 76, in get_scalar data = get_first_row(env, sql, *params) File "/tmp/trachours/sqlhelper/tracsqlhelper/__init__.py", line 20, in __call__ cur = db.cursor() File "build/bdist.linux-x86_64/egg/trac/db/util.py", line 102, in __getattr__ return getattr(self.cnx, name) AttributeError: 'NoneType' object has no attribute 'cursor'
Replying to anonymous:
Scratch that; same error occurs if all components are enabled except for multiproject.
FWIW the real exception is masked by the catchall exception here:
> /tmp/trachours/trac/trac/db/api.py(77)transaction_wrapper() -> fn(ldb) (Pdb) l 72 elif ldb: 73 fn(ldb) 74 else: 75 ldb = _transaction_local.db = env.get_db_cnx() 76 try: 77 -> fn(ldb) 78 ldb.commit() 79 _transaction_local.db = None 80 except: 81 _transaction_local.db = None 82 ldb.rollback()
hi, it actually happens also if I only enable basic components of the plugin:
trachours.hours.trachoursplugin = enabled trachours.setup.setuptrachours = enabled
Also I get in debug log following:
2010-06-18 16:04:15,007 Trac[env] WARNING: Component <trachours.setup.SetupTracHours? object at 0x24dc410> requires environment upgrade 2010-06-18 16:04:15,014 Trac[env] INFO: trachours.setup.SetupTracHours? upgrading... 2010-06-18 16:04:15,016 Trac[console] ERROR: Exception in trac-admin command: Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.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 "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/admin/console.py", line 257, in default return cmd_mgr.execute_command(*args) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/admin/api.py", line 123, in execute_command return f(*fargs) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/env.py", line 790, in _do_upgrade self.env.upgrade(backup=no_backup is None) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/env.py", line 533, in upgrade with_transaction(self)(participant.upgrade_environment) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/api.py", line 82, in transaction_wrapper ldb.rollback() File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/util.py", line 102, in getattr return getattr(self.cnx, name)
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.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 "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/admin/console.py", line 257, in default
return cmd_mgr.execute_command(*args)
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/admin/api.py", line 123, in execute_command
return f(*fargs)
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/env.py", line 790, in _do_upgrade
self.env.upgrade(backup=no_backup is None)
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/env.py", line 533, in upgrade
with_transaction(self)(participant.upgrade_environment)
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/api.py", line 82, in transaction_wrapper
ldb.rollback()
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/util.py", line 102, in getattr
return getattr(self.cnx, name)
AttributeError?: 'NoneType?' object has no attribute 'rollback'
My Trac env: System Information
Trac 0.12 Genshi 0.6 GIT 1.7.0.4 mod_wsgi 2.8 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL}) pysqlite 2.4.1 Python 2.6.5 (r265:79063, Apr 16 2010, 14:15:55) [GCC 4.4.3] setuptools 0.6 SQLite 3.6.22 Subversion 1.6.6 (r40053) jQuery: 1.4.2 Installed Plugins
BatchModify? 0.5.0-trac0.12 /srv/trac/projects/im/plugins/BatchModify-0.5.0_trac0.12-py2.6.egg BreadCrumbsNavPlugin 0.1 /usr/local/lib/python2.6/dist-packages/BreadCrumbsNavPlugin-0.1-py2.6.egg ComponentDependencyPlugin 0.1 /usr/local/lib/python2.6/dist-packages/ComponentDependencyPlugin-0.1-py2.6.egg IniAdmin? 0.2 /usr/local/lib/python2.6/dist-packages/IniAdmin-0.2-py2.6.egg STractistics 0.4.2 /usr/local/lib/python2.6/dist-packages/STractistics-0.4.2-py2.6.egg SvnAuthzAdminPlugin 0.1.2.-Moved.to.Trac.0.11- /usr/local/lib/python2.6/dist-packages/SvnAuthzAdminPlugin-0.1.2._Moved.to.Trac.0.11_-py2.6.egg TicketSidebarProvider? 0.0 /usr/local/lib/python2.6/dist-packages/TicketSidebarProvider-0.0-py2.6.egg timingandestimationplugin 0.9.4 /usr/local/lib/python2.6/dist-packages/timingandestimationplugin-0.9.4-py2.6.egg TracAccountManager? 0.2.1dev-r7737 /usr/local/lib/python2.6/dist-packages/TracAccountManager-0.2.1dev_r7737-py2.6.egg TracGit? 0.12.0.2dev-r7757 /usr/local/lib/python2.6/dist-packages/TracGit-0.12.0.2dev_r7757-py2.6.egg TracHoursPlugin 0.5.2 /usr/local/lib/python2.6/dist-packages/TracHoursPlugin-0.5.2-py2.6.egg TracMasterTickets? 2.1.3 /usr/local/lib/python2.6/dist-packages/TracMasterTickets-2.1.3-py2.6.egg TracNewsFlash? 1.0.1 /usr/local/lib/python2.6/dist-packages/TracNewsFlash-1.0.1-py2.6.egg TracStats? 0.3 /usr/local/lib/python2.6/dist-packages/TracStats-0.3-py2.6.egg TracSubTicketsPlugin? 0.1.0 /srv/trac/projects/im/plugins/TracSubTicketsPlugin-0.1.0-py2.6.egg TracSVNHooks 0.4 /usr/local/lib/python2.6/dist-packages/TracSVNHooks-0.4-py2.6.egg TracTocMacro? 11.0.0.3 /usr/local/lib/python2.6/dist-packages/TracTocMacro-11.0.0.3-py2.6.egg TracWebAdmin? 0.1.2dev-r8925 /usr/local/lib/python2.6/dist-packages/TracWebAdmin-0.1.2dev_r8925-py2.6.egg TracWysiwyg? 0.2-r7772 /usr/local/lib/python2.6/dist-packages/TracWysiwyg-0.2_r7772-py2.6.egg
Best, Vasja
Hi Vasja,
I've found a fix for this. It requires a patch on the TracSqlHelperScript dependency. I've reported the issue here:
http://trac-hacks.org/ticket/7262
The patch is attached there, along with a warning: the patch fixes the immediate issue, but I'm not sure if it will cause other problems down the road. So please let me know if you see any other problems after this patch..
I'll update this ticket again, and update trachours' dependency, when that patch is committed; in the meantime you can apply it on your local install of sqlhelperscript and it should fix the immediate problem.
Hi, this indeed helped to fix my problem!
Thank you!
Vasja
I committed the patch to TracSqlHelperScript in a new 0.12 branch there. TracHours? 0.12 branch now has an updated dependency on tracsqlhelperscript/0.12 - committed in r8160.
-ejucovy