[Zope-dev] Q/ regarding 'Broken Product'

Jim Fulton jim@digicool.com
Tue, 08 Jun 1999 13:42:43 +0000


Thomas Riedl wrote:
> 
> Ah, I like turn around THAT short.
> You guys at DigiCool are simply great!

I try to pay close attention to anything
having to do with the database. :)

> ....
> >> =======================
> >> Whenever there's a "severe" error (like a syntax error in the Product
> >> python code), I see a 'broken Product'.
> >>
> >> Sometimes I'm able to fix the error and to then reuse my created Product
> >> instances and all its subsidiary objects.
> >>
> >> Sometimes the Product instance will have ceased to exist, which is quite a
> >> P.I.T.A.
> >
> >I've never seen this.  It would be interesting to use the bbb.py script in
> >the utilities directory (of Zope 2.0a1 or in the public CVS) to create an XML
> >rendition of your database.  This might give you a better idea where your data
> 
>has gone. :)
> 
> I tried, but it breaks on importing 'ppml' when I try to report xml. See
> below...

Is there a ppml.py in your utilities directory?  If not, I can send it to you, 
however, I see what your problem is wrt disappearing instances.  See below.
 
> >Uh, what exactly do you mean by ceased to exist?  What is your evidence
> >for this?  Do they no longer show up in otherwise functioning folders?
> 
> My evidence looks like this:
> I have my Product, XXX.
> I instatiate it.
> It works.
> I break it (by e.g. syntax errors).
> I fix them.
> I change into the /Control Panel/Products
> folder; there's then my still broken Product.
> clicking on it sometimes reveals an instance (created earlier via selecting
> 'XXX' from the selection list, clicking 'Add', a.s.o.), and sometimes
> that (or those) instance(s) aren't visible any longer.
> The XXX Folder reads
>         'There are currently no items in Broken product XXX'
> and offers the 'add something' selection list.
> 
> I believe to have found out this pattern:
> Especially tricky seem to be changes with / deletions of method names, but
> sometimes a carefully left out (;-) paren will do, as long as the error
> occurs in Zope's startup phase.

Ah.  The fact that Zope lets you add items to a Python product
(as apposed to a through-the-web product) is a bug. I'll add this to
the bugs list.

When a Python-based product changes state from broken to OK or
OK to broken, the Zope product object gets recreated.  

Add your instances to a folder in the main tree or in a
through-the-web product.

 
> >> Nevertheless, the Product keeps on showing up as 'Broken', including its
> >> out-dated Traceback, until I "delete" it and restart Zope.
>  >
> >What version of Zope are you using?  I thought 1.10.2 got this right.
> 
> It is 1.10.2, running on a Linux RedHat-5.2 box, python-1.5.1, using
> Zope's own HTTP server (like "python serve.py").

Hm.  Waaaa. I know this is fixed in the current code.

 
> >> Q#1: How can I 'mend' a broken Product w/o deleting it?
> >
> >You *should* be able to just mend it.  If it doesn't show up
> >as mended, then there is a Zope bug.
> 
> Well, then I regard this an undocumented feature... I think it
> doesn't stem from my browser caching data, since I changed its amount
> of cache down to 2k (you know, Netscape and its 'caching' of erroneous
> pages by the last error-free content ...).

I'm guessing that it is a bug in 1.10.2.  This is fixed in 2.0.
In the mean time, you will have to work around the problem by
moving (deleting) the product.  Note that another work-around
may be to modify (create) a version.txt in the product folder.
Also note that, even through the product shows up as broken, 
you may still have a functioning product. Do your product items
show up in the add list?
 
> >> Q#3: When I change attributes of e.g. an anonymous keyword object: will
> >>         this inevitably result in the often_heard_of database
> >>         inflation 'til next pack day?
> >
> >I'm not sure what you are refering to here.  When you change any
> >(persistent) object, a new version of the object is written to the database.
> >The old version is retained until it is packed.
> 
> That's what I intended to ask for.
> 
> So, what shall I do upon the next mysterious disappearance on instances?

See above.  Don't poke instances into the product folder (of a Python
written product.)

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (540) 371-6909              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.