#9000 closed defect (fixed)
Plugin uninstallable in Trac 0.11 - forms sample crashes wiki page, and more issues
Reported by: | anonymous | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | TracFormsPlugin |
Severity: | normal | Keywords: | compatibility i18n |
Cc: | mparker@…, ewalstad@… | Trac Release: | 0.11 |
Description
I am probably doing something wrong here, but I tried both Methods 1 & 2 and get the same crash when I put a sample (laundry list or shopping list) from the TracFormsPlugin wiki pages into my wiki page.
Any suggestion as to what I should try to get this working? We'd really like to use it. I'll put the tracback in the first comment.
Attachments (0)
Change History (20)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Cc: | mparker@… added; anonymous removed |
---|
comment:3 Changed 13 years ago by
Cc: | ewalstad@… added |
---|
It appears that our installation (I work with mparker@…) isn't running any schema migrations. It appears that this plugin requires tables that our SQLite db does not have. However, when we run trac-admin $TRACENV_DIR upgrade
, trac-admin
tells us that no upgrade is required
$ sudo trac-admin $TRACENV_DIR upgrade
...snip hashlib DeprecationWarnings...
Database is up to date, no upgrade necessary.
Do we need these tables ('forms', 'forms_fields' and 'forms_history')? If so, how do we convince trac-admin
to run the schema migration? Our /usr/share/pyshared/trac/upgrades
dir contains dbN.py files from N=3 to N=21 and tracforms/tracdb.py specifies db_version = 14
. Here's the tables we have in our SQLite db:
SQLite version 3.6.22 ... sqlite> .tables attachment enum revision ticket_change auth_cookie milestone session ticket_custom bill_date node_change session_attribute version component permission system wiki custom_report report ticket
Thanks,
Eric.
comment:4 Changed 13 years ago by
Keywords: | install added |
---|
I consider the plugin stable for running it with Trac 0.13dev in production for a couple of months now. However, considering your findings this may be true for Trac 0.12 and beyond only. We'll see.
First to clarify some things from previous comments:
- yes, you - or better: TracForms will need these three tables which names you already figured out correctly
db_version
is strictly related to the plugin in question (here TracForms current), only for detecting/upgrading possible previous installations of TracForms in same environment (as stored in Trac db tablesystem
) - not tracking Trac db version at allTracForms
uses commonIEnvironmentSetupParticipant
methods (seetracforms/tracdb.py
) to detect install/upgrade conditions and should just do the right thing (or we need to find out there, why it doesn't do as expected)- created the tables right away, if no previous plugin version found in system (looking for two different entries named
TracFormDBComponent:version
andforms_version
respectively) - do an incremental upgrade process to the current version depending on the old version found
- created the tables right away, if no previous plugin version found in system (looking for two different entries named
Neither of these seems to happen, right? As I've created two Trac 0.11 test installations I'll give it a try over there and come back at you later with any findings.
comment:5 follow-up: 7 Changed 13 years ago by
To keep you updated I'll post my findings in this and following comments. Please confirm or correct, as you see differences to behavior of your install. I'm testing with Trac 0.11 here:
Skipping "tracforms.formdb = tracforms.formdb": (can't import "cannot import name resource_exists")
Bad, so it doesn't initially load all modules. Will need to fix this in order to proceed. As t:r9928 suggests: "resource_exists now also in 0.11.7.1", this is currently not backwards-compatible with (older) Trac 0.11 releases.
Is it feasible for you to upgrade to latest Trac 0.11? Meanwhile I'll investigate the implications of removing or working around this dependency.
comment:6 follow-up: 8 Changed 13 years ago by
Keywords: | compatibility i18n added; install removed |
---|---|
Status: | new → assigned |
Summary: | Install problem? Sample from documentation crashes page. → Plugin uninstallable in Trac 0.11 - forms sample crashes wiki page, and more issues |
Ok, verbatim copy of code from 0.11-stable/trac/resource.py
at Trac revision 9899 into compat.py
fixes the initial error, environment upgrade gets detected and runs well by the appropriate trac-admin
command.
But not finished. If you proceed with our first laundry list example (or any other form), you'll find after saving the form, that following the context navigation linked to <your_env>/form/1
throws
TypeError: __call__() got an unexpected keyword argument 'form_id'
Root cause is the i18n implementation not being capable of handling all (keyword) arguments. The immediate fix is as simple as replacing the offending tag_(
with tag(_(
.
But then it's going on along a long road I already know all too well. In short: There's considerably more to be done for full Trac 0.11 compatibility here. If you're curious, you'll find similar issues (and fixes in #8963) - not exactly trivial, but no magic either - just i18n related stuff.
As it's more like an enhancement I'll still stick to the initial bug label, because the plugin is explicitly announced for Trac 0.11. I'll just go on and report back by commit messages after implementation and local testing.
Most probably you'll see a number of changes here. Watch out for the next maintenance release - coming soonish. Thank you for your patience so far.
comment:7 Changed 13 years ago by
Replying to hasienda:
To keep you updated I'll post my findings in this and following comments. Please confirm or correct, as you see differences to behavior of your install. I'm testing with Trac 0.11 here:
OK, will-do. We are running the deb package version for Ubuntu 10.04LTS:
$ sudo dpkg --list | grep trac ... ii trac 0.11.7-1...
Is it feasible for you to upgrade to latest Trac 0.11?
No, we want to stay with the Ubuntu packaged version.
comment:8 follow-up: 9 Changed 13 years ago by
Replying to hasienda: ...
Root cause is the i18n implementation not being capable of handling all (keyword) arguments... But then it's going on along a long road I already know all too well. In short: There's considerably more to be done for full Trac 0.11 compatibility here.
Ok.
Most probably you'll see a number of changes here. Watch out for the next maintenance release - coming soonish. Thank you for your patience so far.
Sounds good. I'll watch for ticket updates and will help out with test when/where I can. I'm a Python developer but I don't have i18n experience.
Thanks for your attention to this.
Eric.
comment:9 Changed 13 years ago by
Replying to anonymous:
Sounds good. I'll watch for ticket updates and will help out with test when/where I can. I'm a Python developer but I don't have i18n experience.
Still sounds good to me. Encouraging to know, there's someone who cares. As a matter of fact I've put out tracforms-0.4
more than two months ago, not expecting such big no-go issues by now. Sorry.
Thanks for your attention to this.
Oh, you're welcome. As time goes by and we'll see a new revision I'll be much pleased by confirmed success at your side. That's the way to go.
comment:10 Changed 13 years ago by
(In [10484]) TracFormsPlugin: Establish compatibility with Trac 0.11, refs #9000.
First step towards full backwards-compatibility, that did not exist for a long time, at least since starting the i18n implementation.
Now let's provide a private resource_exists
for older Trac 0.11 revisions.
comment:11 follow-up: 12 Changed 13 years ago by
You'll notice growing 0.11 compatibility in trunk
development branch.
It is my personal preference to have a dedicated development stage and not fiddle with released code. I'll merge the changes back into 0.4 later or - more correctly - tag a later trunk revision as 0.4.1, without the changes, that have already been added for next feature release (0.5).
comment:12 Changed 13 years ago by
Replying to hasienda:
You'll notice growing 0.11 compatibility in
trunk
development branch.It is my personal preference to have a dedicated development stage and not fiddle with released code. I'll merge the changes back into 0.4 later or - more correctly - tag a later trunk revision as 0.4.1, without the changes, that have already been added for next feature release (0.5).
Sounds fine to me. When you are ready for me to test I'll check out, build and install from trunk (or a tag, if you make one).
comment:13 Changed 13 years ago by
Ready - well almost. Let's get some sleep and re-check tomorrow for gotchas and hidden flaws/leftovers. Still I'll ask you to test trunk
before publishing the 0.4.1 maintenance release.
comment:14 Changed 13 years ago by
(In [10487]) TracFormsPlugin: Establish compatibility with Trac 0.11, refs #9000.
Now apply proper fallbacks for gettext
variants similar to fixes for
AccountManagerPlugin:
Genshi templates use dgettext
to reliably extract and translate special
content like button labels. Because for the 0.11 Trac releases this isn't
included into default content of the data
object passed to Genshi alongside
with the template, this has to be added explicitely to each and every data
object created with this plugin.
More importantly, there is some code missing to degrade more complex i18n
calls like dgettext
gracefully for Trac 0.11, so more code has been taken
and adapted from current Trac trunk
to fill in the gap here.
comment:15 Changed 13 years ago by
(In [10488]) TracFormsPlugin: Establish compatibility with Trac 0.11, refs #9000.
Replace tag_
with more capable tag(_(
call to prevent TypeError in
Genshi used by any Trac 0.11 release.
Add Markup
to avoid wrong escape of HTML from Genshi markup.
comment:16 Changed 13 years ago by
I've applied all changes by now. So it's time for testing, with r10489.
I'm looking forward to hear about your experiences to trigger more changes or - in case of success - the release of the appropriate maintenance version.
comment:17 follow-up: 18 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:18 Changed 13 years ago by
Replying to ewalstad@gmail.com:
It seems to be working now (installed from r10489).
Ok, so I'll proceed.
We'll file another ticket if we find any other issues.
Ok, only make sure, you always know and tell, what you're working with. For production I'd recommend to go with the stable version. I'll do the release tonight.
If you go with the development version instead, that you've been testing this time, please be aware of a gradually higher possibility of some roughness at bleeding edge. And you'll miss (wiki) documentation considerably more often than for the stable release.
Be sure to follow commit messages then. Normally I'm writing quite verbose commit messages, so you can easily get a good picture about what's going on. In the same notion I do expect everyone involved to read these statements to avoid unnecessary trouble for you and me.
Thank you very much for your quick responses - very much appreciated.
Oh, you're welcome. I do appreciate your instant feedback as well.
comment:19 Changed 13 years ago by
Hasienda, EW, thank you both so much for your work on this ticket! It is working great for me. We will certainly switch to the production version once you have one out, but with what Eric installed already, I've been building and testing my form for a few hours and it works great. Thanks very much. -Marla
comment:20 Changed 13 years ago by
(In [10490]) TracFormsPlugin: Release maintenance version 0.4.1 for compatibility with Trac 0.11, closes #9000.
These are changes cherry-picked from trunk
and merged into tracforms-0.4 to
establish full compatibility with Trac 0.11 on level with plugin's own claims.
Trac detected an internal error:
TypeError: 'NoneType' object is not iterable
Traceback: