[Zope-DB] POSKeyError with a fresh Zeo Install

Tim Peters tim.peters at gmail.com
Fri Oct 20 15:03:48 EDT 2006


[Jimmy small]
> Setup:
> python 2.3.5
> Zope 2.8.4-final

It's good to know this, but in this specific case none of the above
actually matters.

> appropriate python extensions for windows

One of the log messages suggests your ZEO server box should install a
more-recent pywin32:

> 2006-10-18T14:51:57 WARNING Z2 Can not install signal handlers.  Please
> install (or upgrade) your pywin32 installation (https://sf.net/projects/pywin32)


> When I create 1 zope instance and 1 zeo instance, start the zeo and then
> start the zope instance I see this in my logs.  Note this is the first start
> of the fresh installs.  Does anyone have any suggestions as to the cause?

Yes:  this is expected, under all versions of Zope, and is normal,
with or without ZEO.  Whenever a DB object is created (and at least
one always must be) to mediate access to your database (Data.fs), the
first thing it does is load the database "root object".  But when the
database is initially empty, there /is/ no root object, and that's the
source of:

> 2006-10-18T14:52:44 INFO ZEO.zrpc.Connection(S) (127.0.0.1:1289) loadEx()
> raised exception: 0x00
> Traceback (most recent call last):
> ...
> "C:\Zope\Zope-2.8.4-final\lib\python\ZODB\FileStorage\FileStorage.py", line 514, in _lookup_pos
>     raise POSKeyError(oid)
> POSKeyError: 0x00

The object with oid 0 (0x00 above) is the root object, but it doesn't
initially exist.  The client catches this POSKeyError, and /creates/
the root object as a result.  On the client side, you're in this part
of DB.__init__() at the time:

        try:
            storage.load(z64,'')
        except KeyError:
            # Create the database's root in the storage if it doesn't exist

So every time you have an empty database, the first time you access it
you should expect one of these.  It would be nicer if the log message
were suppressed, but that occurs at a lower level:  by the time the
KeyError is caught here, the log message has already been generated.


More information about the Zope-DB mailing list