[ZODB-Dev] Problem with Bsddb3Storage.copyTransactionsFrom

Chris Withers chrisw@nipltd.com
Fri, 19 Oct 2001 15:05:56 +0100


Hi, 

I'm trying to use the following script to pour transactions out of a FileStorage
(Zope 2.4.0) into a BerkleyStorage (1.0b4) (having given up on FileStorage from
a scalability point of view :-S):

> import sys
> import os
> 
> print "start"
> 
> SOFTWARE_HOME="/usr/local/zope/2.4.0_base"
> INSTANCE_HOME="/var/local/zope/production"
> 
> sys.path.insert(0, SOFTWARE_HOME)
> sys.path.insert(0, os.path.join(SOFTWARE_HOME,'lib','python'))
> sys.path.insert(0, os.path.join(INSTANCE_HOME,'lib','python'))
> 
> from ZODB.FileStorage import FileStorage
> from bsddb3Storage.Full import Full
> 
> print "done imports"
> 
> src = FileStorage(os.path.join(INSTANCE_HOME,'var','Data.fs'))
> print "opened file storage"
> 
> env = os.path.join(INSTANCE_HOME, 'var', 'bsddb3Storage')
> dst = Full(name='BerkeleyStorage', env=env)
> print "opened bdb storage"
> 
> dst.copyTransactionsFrom(src)
> print "copied transacations"
> 
> src.close()
> dst.close()
> print "done"

This is currently failing with:

Traceback (most recent call last):
  File "fs2bdbs.py", line 25, in ?
    dst.copyTransactionsFrom(src)
  File "/usr/local/zope/2.4.0_base/lib/python/ZODB/BaseStorage.py", line 293, in
copyTransactionsFrom
    s=self.store(oid, pre, r.data, r.version, transaction)
  File "/var/local/zope/storage/lib/python/bsddb3Storage/Full.py", line 573, in
store
  File "/usr/local/zope/2.4.0_base/lib/python/ZODB/utils.py", line 109, in U64
    h, v = unpack(">II", v)
TypeError: unpack() argument 2 must be string or read-only buffer, not None

Anyone got any ideas on what this means, what's causing it and how it should be
fixed?

cheers,

Chris