[Zope] Debugging product init with zopectl?
J Cameron Cooper
zope-l at jcameroncooper.com
Fri May 6 12:48:54 EDT 2005
Konrad Rokicki wrote:
> Hi all,
> I'm new to Zope, getting started with the "minimal" project
> (http://www.zope.org/Members/maxm/HowTo/minimal_01). For whatever
> reason, minimal doesn't work out of the box. That would be fine except
> that when I start Zope with zopectl it reports status as fine and the
> process runs, but I don't get any logs generated and I can't connect
> to the server.
>
> But, if I use runzope I can see what's wrong and the server dies immediately:
> File "/var/lib/zope/zope-test/Products/minimal/__init__.py", line 8,
> in initialize
> constructors = (
> AttributeError: manage_addMinimalForm
>
> My concern isn't this error, which I fixed by importing the function
> explicitly. But why did I have to use runzope to see this? Shouldn't
> zopectl inform me that the server is completely broken?
>
> By the way, I'm using a standard Gentoo installation of Zope, and I
> haven't changed any options from defaults.
>
> Could someone please tell me if this is expected behavior? Should I be
> using runzope in a screen or something?
The 'zopectl' script launches as a daemon, so it has no place to write
output to screen. It does write to the log file. Problem is, the logfile
isn't usable until after startup, so startup errors cannot be logged.
I agree, it would be nice to have zLOG work on startup, but I don't know
how easy/possible that is.
In debug mode (the default) Zope fails when a Product fails to init.
This is useful when running 'runzope' since you don't have to kill Zope.
Without debug mode, Zope will start up, but the Product will be broken,
and its failure listed in the Products section of the Control Panel.
If you suspect Product init failure, you should use runzope. I do, in
general, during devlopment of those parts.
--jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com/
More information about the Zope
mailing list