[ZODB-Dev] [FileStorage] "description too long" error

Alan Runyan runyaga at gmail.com
Sat Jan 12 09:59:01 EST 2008


Leaky implementation details everywhere ;-(

Plone writes 'human legible' transaction notes.  So the 'undo' screens in ZMI
were a bit more useful.

ZODB has a MAX transaction header length of 64k-1.

Plone's attempt to calculate the transaction header length seems to be
incorrect.
see CMFPlone.utils.transaction_note

ZODB's error handling of transaction header length may be incorrect as well:

the code in FileStorage.py:

def _begin(self, tid, u, d, e):
     self._nextpos = 0
     self._thl = TRANS_HDR_LEN + len(u) + len(d) + len(e)
     if self._thl > 65535:
         # one of u, d, or e may be > 65535
        # We have to check lengths here because struct.pack
        # doesn't raise an exception on overflow
        if len(u) > 65535:
            raise FileStorageError('user name too long')
        if len(d) > 65535:
             raise FileStorageError('description too long')
        if len(e) > 65535:
            raise FileStorageError('too much extension data')

1. What if each u, d, e were each 32k?  this exception would
not be triggered.

2.  Should there be a more robust calculation in
  ZODB.FileStorage.FileStorage_begin to guarantee an exception?

3. There certainly should be a raise FileSorageError('transaction
header too long')
if none of the if len(e) > 64k-1 are triggered.

Andreas,
CMFPlone.utils.transaction_note
if (len(T.description)+len(note))>=65535:
    log('Transaction note too large omitting %s' % str(note))

Note sure how description got to be > 64k-1. since in Plone
it does not write the transaction note under such circumstance.

cheers
alan

---------- Forwarded message ----------
From: Andreas Jung <lists at zopyx.com >
Date: Jan 12, 2008 8:09 AM
Subject: [ZODB-Dev] [FileStorage] "description too long" error
To: zodb-dev at zope.org


Hi,

running Zope 2.10.5 with Plone 3.0.5. While performing a workflow transition
for all subjects within a tree (roughly about 3000 objects) I encountered
the following error:


:8080/20080112-123756/content_status_history
Traceback (innermost last):
  Module ZPublisher.Publish, line 125, in publish
  Module Zope2.App.startup, line 238, in commit
  Module transaction._manager, line 96, in commit
  Module transaction._transaction, line 395, in commit
  Module transaction._transaction, line 493, in _commitResources
  Module ZODB.Connection, line 494, in tpc_begin
  Module ZODB.BaseStorage, line 238, in tpc_begin
  Module ZODB.FileStorage.FileStorage, line 863, in _begin
FileStorageError: description too long

What's going on here?

Andreas

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev at zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev




-- 
Alan Runyan
Enfold Systems, Inc.
http://www.enfoldsystems.com/
phone: +1.713.942.2377x111
fax: +1.832.201.8856
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20080112/6bc2f814/attachment.bin


More information about the ZODB-Dev mailing list