[Zope-dev] Better diagnostics during product load?

Loren Stafford lstaffor@dynalogic.com
Tue, 22 Feb 2000 15:10:12 -0800


Thanks Tres, Jonothan, et al.

My Zope was already running in -D mode; however the tracebacks were getting
eaten somewhere.

I hadn't learned to run Zope interactively from the Python interpreter
before, but started to based on Jonothan's suggestion. Now I see how
powerful a tool the Python interpreter is. Searching back thru the archives,
I learned about
    import Zope
    root=app(Zope)
    ...etc

Now I'm really dangerous (like any fool with a powerful new tool).  8-)

I discovered more or less what my problem was. It seems that before deleting
a product, Zope checks to see if there is an old copy of the product. In my
case there was an existing copy, tho I don't understand why. Are products
persistent? My product has a manage_beforeDelete hook. That procedure was
causing some error (I still don't know why); therefore, because Zope
couldn't delete the old product, it failed to install the new product. The
Control_Panel product screen showed a perfectly normal product (the old
one); the traceback for loading the new product had nowhere to go (usually
is shown on Product management tab), so it disappeared (didn't go to zLOG
either).

I worked around the problem by starting from a fresh data.fs; but sooner or
later I'll have to find out why the delete hook failed.

-- Loren

> Loren Stafford <lstaffor@dynalogic.com> wrote:
> >
> > Often, when Zope tries to load my product, it logs the simple error
message:
> >     2000-02-21T23:51:57 ERROR(200) Zope Couldn't install MyProduct
> > There is no traceback, not in the log and not in the product screen of
the
> > Control Panel. I presume the problem is syntax errors in the Python code
of
> > the product.
> >
> > How can I get Zope to show me a traceback pointing out the syntax
errors?
>
> The simplest thing to do is to run Zope from the command line, passing the
'-D'
> flag to tell it to run in debug mode (the default "start" script does
this).
> The traceback from the failed product import will then dump to the console

(I
> think).
>
> Tres.