Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#469770: python2.5: Old shelve files broken by DB4.6 reversion

19 views
Skip to first unread message

Steve Greenland

unread,
Mar 6, 2008, 7:10:15 PM3/6/08
to
Package: python2.5
Version: 2.5.2-1
Severity: normal


Traceback (most recent call last):
File "python/main.py", line 519, in ?
sys.exit(main())
File "python/main.py", line 446, in main
db = shelve.open(sfile, protocol=2, writeback=False)
File "/usr/lib/python2.4/shelve.py", line 234, in open
return DbfilenameShelf(filename, flag, protocol, writeback, binary)
File "/usr/lib/python2.4/shelve.py", line 215, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback, binary)
File "/usr/lib/python2.4/anydbm.py", line 83, in open
return mod.open(file, flag, mode)
File "/usr/lib/python2.4/dbhash.py", line 16, in open
return bsddb.hashopen(file, flag, mode)
File "/usr/lib/python2.4/bsddb/__init__.py", line 298, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- /home/steveg/.main.files: unsupported hash version: 9')

What are my options from here? "Recreate the shelf from scratch" is not
a good answer. Yeah, I *can* do it, but breaking compatibility like this
is generally a no-no...if there's a way to use the db4 utilities to
rescue this, it should be in the README.Debian.


-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (900, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages python2.5 depends on:
ii libbz2-1.0 1.0.4-3 high-quality block-sorting file co
ii libc6 2.7-9 GNU C Library: Shared libraries
ii libdb4.5 4.5.20-11 Berkeley v4.5 Database Libraries [
ii libncursesw5 5.6+20080203-1 Shared libraries for terminal hand
ii libreadline5 5.2-3 GNU readline and history libraries
ii libsqlite3-0 3.5.6-3 SQLite 3 shared library
ii libssl0.9.8 0.9.8g-7 SSL shared libraries
ii mime-support 3.40-1.1 MIME files 'mime.types' & 'mailcap
ii python2.5-minimal 2.5.2-1 A minimal subset of the Python lan

python2.5 recommends no packages.

-- no debconf information

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Matthias Klose

unread,
Mar 6, 2008, 7:30:11 PM3/6/08
to
Steve Greenland writes:
> Package: python2.5
> Version: 2.5.2-1
> Severity: normal
>
>
> Traceback (most recent call last):
> File "python/main.py", line 519, in ?
> sys.exit(main())
> File "python/main.py", line 446, in main
> db = shelve.open(sfile, protocol=2, writeback=False)
> File "/usr/lib/python2.4/shelve.py", line 234, in open
> return DbfilenameShelf(filename, flag, protocol, writeback, binary)
> File "/usr/lib/python2.4/shelve.py", line 215, in __init__
> Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback, binary)
> File "/usr/lib/python2.4/anydbm.py", line 83, in open
> return mod.open(file, flag, mode)
> File "/usr/lib/python2.4/dbhash.py", line 16, in open
> return bsddb.hashopen(file, flag, mode)
> File "/usr/lib/python2.4/bsddb/__init__.py", line 298, in hashopen
> d.open(file, db.DB_HASH, flags, mode)
> bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- /home/steveg/.main.files: unsupported hash version: 9')
>
> What are my options from here? "Recreate the shelf from scratch" is not
> a good answer. Yeah, I *can* do it, but breaking compatibility like this
> is generally a no-no...if there's a way to use the db4 utilities to
> rescue this, it should be in the README.Debian.

sorry for the "mess". you should be able to use the db4.6-utils to
export the database and then use the db4.5-utils to recreate the
database. An suggested text for README.Debian would be very welcome.

Matthias

Steve Greenland

unread,
Mar 10, 2008, 4:10:09 PM3/10/08
to
On 06-Mar-08, 18:24 (CST), Matthias Klose <do...@cs.tu-berlin.de> wrote:
> sorry for the "mess". you should be able to use the db4.6-utils to
> export the database and then use the db4.5-utils to recreate the
> database. An suggested text for README.Debian would be very welcome.

Okay, fair enough, here's my pass at "README.db4". Please correct any
misunderstandings about the history.

======================================================================

The Debian version of Python 2.5 was originally built using Berkely DB
4.6. Due to problems with DB 4.6, this was reverted to DB 4.5 in Debian
package 2.5.1-7. However, databases created (or modified?) by DB 4.6 are
not usuable by DB 4.5; a common indicator is this exception:

bsddb.db.DBInvalidArgError: (22, 'Invalid argument --

/some/file/name: unsupported hash version: 9')

Note that you may not have explicitly used the bsddb extension, as other
modules (such as anydbm and shelve) may use bsddb.

To restore Python 2.5 access to your existing DB 4.6 file, you need
to install two packages: db4.5-util and db4.6-util. Then, to recover
the file "example.db", use the following sequence of commands, noting
carefully the distinction between 4.5 and 4.6:

$ mv example.db example.db.db46
$ db4.6-dump example.db.db46 | db4.5-load example.db

======================================================================


Regards,
Steve

--
Steve Greenland
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the
world. -- seen on the net

0 new messages