bsddb in python 2.5.1

B

BjornT

Have a rather big problem with bsddb I can't figure out. I upgraded an
Ubuntu machine from 7.05 to 7.10 which upgraded python to 2.5.1

I run a local website that uses bsddb, and suddenly I get a version
mismatch error with bsddb and I can't access my database anymore

I noticed in the 2.5.1 release notes:

- fixed a bug with bsddb.DB.stat: the flags and txn keyword arguments
were transposed.

- Added support for linking the bsddb module against BerkeleyDB 4.5.x.

http://www.python.org/download/releases/2.5.1/NEWS.txt

I know that when you upgrade Berkeley DB you're supposed to go through
steps solving this problem,but I wasn't expecting an upgrade. I've
tried to use different versions bsddb3, 4.4 and 4.5, (instead of bsddb
that comes with python 2.5.1) with different versions of Berkeley DB
installs (4.5 and 4.4 - built from source into /usr/local). But this
isn't working.

I can't seem a way to figure out how to recover my data. Please help. :
(
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

I know that when you upgrade Berkeley DB you're supposed to go through
steps solving this problem,but I wasn't expecting an upgrade. I've
tried to use different versions bsddb3, 4.4 and 4.5, (instead of bsddb
that comes with python 2.5.1) with different versions of Berkeley DB
installs (4.5 and 4.4 - built from source into /usr/local).

There seems to be an important misconception here. Python 2.5.1 does
not come with any bsddb version whatsoever. If you have a Python binary
where the bsddb module is linked with a certain version of Python, that
was the choice of whoever made the Python binary.

For acccess to the database, the Python version does not matter at all.
What matters is the version of Berkeley DB.

So as the first step, you should find out what version of Berkeley DB
the old Python installation was using, and what version of Berkeley DB
the new version is using.

I'm also not sure what you mean by "I've tried to use different version
bsddb3, 4.4 and 4.5". What specifically did you do to try them? AFAICT,
Ubuntu "Feisty Fawn" linked its Python with bsddb 4.4, so you should
have no version issues if you really managed to use bsddb 4.4.

Can you please report the specific error you got? According to the
Berkeley DB documentation, there was no change to database formats
in Berkeley DB 4.5 (but there was a change to the log file format).

Regards,
Martin
 
B

BjornT

There seems to be an important misconception here. Python 2.5.1 does
not come with any bsddb version whatsoever. If you have a Python binary
where the bsddb module is linked with a certain version of Python, that
was the choice of whoever made the Python binary.

For acccess to the database, the Python version does not matter at all.
What matters is the version of Berkeley DB.

So as the first step, you should find out what version of Berkeley DB
the old Python installation was using, and what version of Berkeley DB
the new version is using.

I'm also not sure what you mean by "I've tried to use different version
bsddb3, 4.4 and 4.5". What specifically did you do to try them? AFAICT,
Ubuntu "Feisty Fawn" linked its Python with bsddb 4.4, so you should
have no version issues if you really managed to use bsddb 4.4.

Can you please report the specific error you got? According to the
Berkeley DB documentation, there was no change to database formats
in Berkeley DB 4.5 (but there was a change to the log file format).

Regards,
Martin

Hi,

Thank you for your reply. My exact error (when I use bsddb that came
with Ubuntu's python 2.5.1) is as follows:


2007-11-04 13:23:05: (mod_fastcgi.c.2588) FastCGI-stderr: Traceback
(most recent call last):
File "/usr/lib/python2.5/site-packages/web/webapi.py", line 304, in
wsgifunc
result = func()
File "/usr/lib/python2.5/site-packages/web/request.py", line 129, in
<lambda>
func = lambda: handle(getattr(mod, name), mod)
File "/usr/lib/python2.5/site-packages/web/request.py", line 61, in
handle
return tocall(*([x and urllib.unquote(x) for x in args] + fna))
File "/home/bjorn/karmerd-svn/karmerd.py", line 6, in GET
self.handleRequest("GET", path)
File "/home/bjorn/karmerd-svn/karmerd.py", line 14, in handleRequest
request_api = api.Api(path, input, web.ctx, type)
File "/home/bjorn/karmerd-svn/api.py", line 14, in __init__
self.a = kapilib.abuse.Abuse(input, identity, self.pathParts[1],
apilib);
File "/home/bjorn/karmerd-svn/kapilib/abuse.py", line 26, in
__init__
d.addEntry(identity.ip, self.target, time.time())
File "/home/bjorn/karmerd-svn/dal/abusedal.py", line 11, in addEntry
env = dal.dalbase.Dal._getOpenEnv(self)
File "/home/bjorn/karmerd-svn/dal/dalbase.py", line 94, in
_getOpenEnv
env.open(path, flags)
DBError: (-30972, "DB_VERSION_MISMATCH: Database environment version
mismatch -- Program version 4.5 doesn't match environment version
4.4")

As I have said I have two versions of Berkeley DB installed in /usr/
local:

drwxr-xr-x 6 root root 4096 2007-11-03 13:51 BerkeleyDB.4.4
drwxr-xr-x 6 root root 4096 2007-06-09 14:04 BerkeleyDB.4.5

I have two versions of bsddb3 installed (only one is active) this is
from /usr/lib/python2.5/site-packages:
drwxr-xr-x 3 root root 4096 2007-11-03 15:01 bsddb3
-rw-r--r-- 1 root root 905 2007-11-03 15:39 bsddb3-4.4.2.egg-info
-rw-r--r-- 1 root root 905 2007-11-03 15:49 bsddb3-4.5.0.egg-info

And of course I have this, which was just in Python 2.5 as it came in
Ubuntu:
drwxr-xr-x 2 root root 4096 2007-11-02 19:32 bsddb

As per:

"> Ubuntu "Feisty Fawn" linked its Python with bsddb 4.4, so you
should
have no version issues if you really managed to use bsddb 4.4."

I tried to use bsddb3, which I downloaded from sourceforge to link to
the different versions of berkeley db I have, but trying to open the
database just stalls, there's never a response. In the interactive
interpreter, I never get the prompt back, I have to kill they python
process. I'm really at a loss of what I could do, except for reverting
back to Ubuntu 7.05. In the future I plan on not using what ships with
the OS, but from source or binaries that I install so I can have
control over the update process.
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

I have two versions of bsddb3 installed (only one is active) this is
from /usr/lib/python2.5/site-packages:
drwxr-xr-x 3 root root 4096 2007-11-03 15:01 bsddb3
-rw-r--r-- 1 root root 905 2007-11-03 15:39 bsddb3-4.4.2.egg-info
-rw-r--r-- 1 root root 905 2007-11-03 15:49 bsddb3-4.5.0.egg-info

This makes two installations, but how do you know that they really link
with two different versions of Berkeley DB?
I'm really at a loss of what I could do, except for reverting
back to Ubuntu 7.05.

What's wrong with upgrading the database files to 4.5? Just run the
proper db_upgrade binary.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top