[ZODB-Dev] Re: Database Corruption.

Tim Peters tim at zope.com
Wed Jun 30 14:30:24 EDT 2004


[Ramon Aseniero]
> 2004-06-28T18:02:30 ERROR(200) ZODB Couldn't load state for
> '\x00\x00\x00\x00\x00\x02y\x89' Traceback (innermost last):
>   File /usr/lib/zope/lib/python/ZODB/Connection.py, line 551, in
setstate
>   File /usr/lib/zope/lib/python/ZODB/FileStorage.py, line 645, in load
>     (Object: /village/zope/default/var/Data.fs)
>   File /usr/lib/zope/lib/python/ZODB/FileStorage.py, line 623, in _load
>     (Object: /village/zope/default/var/Data.fs)
> error: unpack str size does not match format

This is certainly peculiar.  The failing unpack is the last line here:

    def _load(self, oid, version, _index, file):
        try:
            pos = _index[oid]
        except KeyError:
            raise POSKeyError(oid)
        file.seek(pos)
        read = file.read
        h = read(DATA_HDR_LEN)
        doid, serial, prev, tloc, vlen, plen = unpack(DATA_HDR, h)

The only ways I see that we *could* get a "str size does not match format"
error are:  (a) I/O on this box is plain broken; or, (b) the object is at
the very end of a "truncated" .fs file, so that fewer than DATA_HDR_LEN
bytes remain to be read.

I don't recall ever seeing a report of this failure mode before.

Ramon, I assume you don't truncate your Data.fs file to random sizes at
random times <wink>.



More information about the ZODB-Dev mailing list