#12931 closed defect (fixed)
AttributeError when using TicketImportPlugin in Trac 1.2
Reported by: | Jacob | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | TicketImportPlugin |
Severity: | normal | Keywords: | |
Cc: | Jun Omae | Trac Release: | 1.2 |
Description
When I try importing a file in Trac 1.2, I get:
Trac detected an internal error: AttributeError: 'Environment' object has no attribute 'get_db_cnx'
Attachments (1)
Change History (18)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Owner: | changed from François Granade to Jun Omae |
---|---|
Status: | new → accepted |
Hi farialima,
I worked to make compatible with Trac 1.1.2+ two years ago. I resume it. Thanks.
comment:3 Changed 8 years ago by
The plugin is important enough for me that I've decided to not upgrade to 1.2 until I can get it and a few other business-critical plugins working.
I should have mentioned that it was version 0.8.3 of TicketImport 0.8.3 that was causing the error, I couldn't find a more recent version.
Batch Modify does some of what I need, but not everything. I actually don't understand why Trac would have a built-in export function (i.e. ability to download results as CSV) without also having a built-in import function...
The only other plugin I could find that does something similar is ExportImportXlsPlugin. I tried it but that didn't work either (although it broke differently), and I prefer TicketImportPlugin's simplicity.
Thanks to both you! Looking forward to the update, and I can help test it for you.
comment:4 Changed 8 years ago by
I just create proposed patch, https://github.com/jun66j5/ticketimportplugin/compare/master...t12931.diff.
comment:6 Changed 8 years ago by
You could download patched source via https://github.com/jun66j5/ticketimportplugin/archive/t12931.zip.
comment:7 follow-up: 8 Changed 8 years ago by
I tried installing the patch:
easy_install ticketimportplugin-t12931/ Processing Writing /tmp/ticketimportplugin-t12931/setup.cfg Running setup.py -q bdist_egg --dist-dir /tmp/ticketimportplugin-t12931/egg-dist-tmp-04tNho TicketImport 0.8.3 is already the active version in easy-install.pth Installed /usr/local/lib/python2.7/dist-packages/TicketImport-0.8.3-py2.7.egg Processing dependencies for TicketImport==0.8.3 Finished processing dependencies for TicketImport==0.8.3
And when I try an import, Internal Error is still happening.
comment:8 follow-up: 9 Changed 8 years ago by
And when I try an import, Internal Error is still happening.
Please post the errors with stacktrace after enabling TracLogging.
comment:9 Changed 8 years ago by
Replying to jun66j5:
And when I try an import, Internal Error is still happening.
Please post the errors with stacktrace after enabling TracLogging.
Works for me. Confirmed with Trac 1.2 and the t12931.zip.
comment:10 Changed 8 years ago by
Did I install the patch properly?
Is it normal that it says 0.8.3 is already the active version?
Could this be a conflict with a different plugin?
comment:11 Changed 8 years ago by
Please post the errors with stacktrace after enabling TracLogging.
Also,
- You should uninstall un-patched TicketImportPlugin first.
- Confirm missing
Import
tab in navigation menu after the plugin is uninstalled - Install t12931.zip
comment:12 Changed 8 years ago by
Ok. Followed your steps outlined above.
There is progress. I am now able to preview the import file, and cancel the import without errors, but if I instead choose to go ahead and Execute Import, I get the same AttributeError.
I've attached the stacktrace, the error is at the end.
Changed 8 years ago by
Attachment: | 12931-AttributeError-stacktrace.txt added |
---|
stacktrace of AttributeError on Execute Import with patch t12931
comment:13 follow-up: 14 Changed 8 years ago by
That's a MasterTicketsPlugin issue. Retry after uninstalling MasterTicketsPlugin.
File "/usr/local/lib/python2.7/dist-packages/Trac-1.2-py2.7.egg/trac/ticket/model.py", line 397, in save_changes listener.ticket_changed(self, comment, author, old_values) File "/usr/local/lib/python2.7/dist-packages/TracMasterTickets-3.0.5dev_r12950-py2.7.egg/mastertickets/api.py", line 117, in ticket_changed db = self.env.get_db_cnx() AttributeError: 'Environment' object has no attribute 'get_db_cnx'
comment:14 Changed 8 years ago by
File "/usr/local/lib/python2.7/dist-packages/Trac-1.2-py2.7.egg/trac/ticket/model.py", line 397, in save_changes listener.ticket_changed(self, comment, author, old_values) File "/usr/local/lib/python2.7/dist-packages/TracMasterTickets-3.0.5dev_r12950-py2.7.egg/mastertickets/api.py", line 117, in ticket_changed db = self.env.get_db_cnx() AttributeError: 'Environment' object has no attribute 'get_db_cnx'
See #12193.
comment:15 Changed 8 years ago by
You're right. If I disable MasterTicketsPlugin, I can now import successfully. Yes!
hi, we haven't updated this plugin to work with the latest versions of Trac; in fact it hasn't been maintained for a few years... If there is still some interest to it, I could work at upgrading it, I don't think it should be too difficult. Please tell me how important it is to you. In particular: are there other, more recent, better maintained, plugins that would do the job ? if yes, please use them; if not, tell me and I'll try to work on it. Thank !