Mailing List Archive

POSKeyError with a fresh Zeo Install
Setup:
python 2.3.5
Zope 2.8.4-final
appropriate python extensions for windows


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?

2006-10-18T14:49:48 INFO ZEO.runzeo (4800) removed PID file
'c:\zope\zeo\var\ZEO.pid'
------
2006-10-18T14:51:56 INFO ZEO.runzeo (5576) created PID file
'c:\zope\zeo\var\ZEO.pid'
------
2006-10-18T14:51:56 INFO ZEO.runzeo (5576) opening storage '1' using
FileStorage
------
2006-10-18T14:51:56 WARNING ZODB.FileStorage Ignoring index for
c:\zope\zeo/var/Data.fs
------
2006-10-18T14:51:57 WARNING Z2 Can not install signal handlers. Please
install (or upgrade) your pywin32 installation (
https://sf.net/projects/pywin32)
------
2006-10-18T14:51:57 INFO ZEO.StorageServer (5576) StorageServer created RW
with storages: 1:RW:c:\zope\zeo/var/Data.fs
------
2006-10-18T14:51:57 INFO ZEO.zrpc (5576) listening on ('', 9555)
------
2006-10-18T14:52:44 INFO ZEO.StorageServer (5576) new connection ('127.0.0.1',
1289): <ManagedServerConnection ('127.0.0.1', 1289)>
------
2006-10-18T14:52:44 INFO ZEO.zrpc.Connection(S) (127.0.0.1:1289) received
handshake 'Z303'
------
2006-10-18T14:52:44 INFO ZEO.zrpc.Connection(S) (127.0.0.1:1289) loadEx()
raised exception: 0x00
Traceback (most recent call last):
File "C:\Zope\Zope-2.8.4-final\lib\python\ZEO\zrpc\connection.py", line
421, in handle_request
ret = meth(*args)
File "C:\Zope\Zope-2.8.4-final\lib\python\ZEO\StorageServer.py", line 248,
in loadEx
return self.storage.loadEx(oid, version)
File "C:\Zope\Zope-2.8.4-final\lib\python\ZODB\FileStorage\FileStorage.py",
line 523, in loadEx
pos = self._lookup_pos(oid)
File "C:\Zope\Zope-2.8.4-final\lib\python\ZODB\FileStorage\FileStorage.py",
line 514, in _lookup_pos
raise POSKeyError(oid)
POSKeyError: 0x00
Re: POSKeyError with a fresh Zeo Install [ In reply to ]
Wrong list, you want the main zope list and/or zodb-dev.
This list is for relational database use with zope.

-PW

On Fri, Oct 20, 2006 at 02:31:22PM -0400, Jimmy small wrote:
> Setup:
> python 2.3.5
> Zope 2.8.4-final
> appropriate python extensions for windows
>
>
> 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?
(snip)

--

Paul Winkler
http://www.slinkp.com
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: POSKeyError with a fresh Zeo Install [ In reply to ]
[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.
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: POSKeyError with a fresh Zeo Install [ In reply to ]
Thanks for your answers Tim!

That was very helpful.

-Jimmy

On 10/20/06, Tim Peters <tim.peters@gmail.com> wrote:
>
> [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.
>