Zope 2.x bug in loading products
After further experiments, I am ready to call my earlier report a bug. In brief: After a failed import of a product which results in a traceback, if the bug is fixed but the product still won't load, the product manager still reports a failed load with the old traceback. Here are more details. I will upload a zip file with the offending product to my zope site when this is done. I have reproduced the results under Zope 2.0.1 and 2.1.0b2. I am running on NT 4, SP 4. Here's the sequence to reproduce the problem: 1) Unzip OrgUser in the Products directory. 2) Edit the 3rd line of OrgUser.py to read import nonsense 3) start zope 4) Go to the management control panel, products. OrgUser is reported as a broken product, with a traceback indicating a failure to import nonsense. This is *not* the bug; it is proper behavior. 5) Shutdown Zope 6) Edit OrgUser.py to comment out import nonsense 7) Restart Zope 8) The management control panel for products still shows the same as in step 4. This *is* a bug, since that line no longer exists. I presume there is some other problem with the product which prevents if from loading. 9) If you want shutdown Zope and delete the database. Recreate it. Now you will see no report of OrgUser in the Products listing. This indicates that when the product fails to load, it leaves the old error message in place. I suspect this problem may be caused by a problem in the interaction of error reporting with transactions boundaries. I see that when there's an error, various actions are taken and then the transaction is aborted. Perhaps this throws out the correct error information.
Ross Boylan wrote: [snip decription]
8) The management control panel for products still shows the same as in step 4. This *is* a bug, since that line no longer exists. I presume there is some other problem with the product which prevents if from loading.
I think I can confirm the same type of thing happening to me during product development. I'm not entirely sure though, as I've done a *lot* of Zope restarting during product development.
9) If you want shutdown Zope and delete the database. Recreate it. Now you will see no report of OrgUser in the Products listing.
I think what helped in my case was deleting the product from the listing (on the product management screen), then restarting. The healed product would show up then.
This indicates that when the product fails to load, it leaves the old error message in place.
Does the product work at all in such a state? Did you try? I mean, is this a cosmetic error or is something weird going on underneath? Regards, Martijn
I thought I noticed the same thing happening-- a syntax error in MyProduct.py causes my Product to show up Broken. I fix it, but the Product _still_ shows up as broken with the old error message. The problem was that I _also_ had an error in my __init__.py's initialize method, which fails silently(?). Once I noticed and fixed that, I was on the road again. Mike.
I believe the problem I had was also caused by a silent failure in __init__.py. When registering a class you need to provide a tuple of methods to create it. I provided only 1, so the (method) became a method, not a tuple. I noticed this because I tried the same thing with some other code for __init__.py that did error trapping and caught it. The fix, by the way, is to use (method, ) syntax. Because this is intimately tied to python's module mechanism, it may be hard to trap the errors at a higher level. If not, I hope the product manager can be changed to do the right thing and log failures in __init__.py.
-----Original Message----- From: Mike Pelletier [mailto:mike@digicool.com] Sent: Tuesday, November 23, 1999 7:12 AM To: zope@zope.org; Ross Boylan Subject: Re: [Zope] Zope 2.x bug in loading products
I thought I noticed the same thing happening-- a syntax error in MyProduct.py causes my Product to show up Broken. I fix it, but the Product _still_ shows up as broken with the old error message. The problem was that I _also_ had an error in my __init__.py's initialize method, which fails silently(?). Once I noticed and fixed that, I was on the road again.
Mike.
participants (4)
-
Martijn Faassen -
Mike Pelletier -
Ross Boylan -
Ross Boylan