bsddb 4.2.52 DBInvalidArgError 22 Invalid argument
Asked Answered
L

1

1

I am simply trying to call open in Python using bsddb but running into the following error. Any idea? If not, is there a way to get a more detailed error message for debugging, getting more info can probably help me investigate a little further. An error code without much details certainly doesn't help much.

DBInvalidArgError: (22, 'Invalid argument')

Source:

import bsddb, bsddb.db

...
try:
    e = bsddb.db.DBEnv()
    e.open('/mydir', bsddb.db.DB_CREATE | bsddb.db.DB_INIT_MPOOL)
...

Additional info: In /mydir I have a DB_CONFIG file:

set_data_dir /mydir/current_data
# 128MB
set_cachesize 0 134217728 1

Update: I think I am onto something here as it has something to do with bsddb & bsddb.db versions:

> $python
> Python 2.5...
> import bsddb, bsddb.db
> print bsddb.__version__, bsddb.db.version()
> 4.4.5 (4, 2, 52)
> bsddb.db.DBEnv().open('/mydir/')
> bsddb.db.DBInvalidArgError: (22, 'Invalid argument')

> $python2.6
> Python 2.6.6...
> import bsddb, bsddb.db
> print bsddb.__version__, bsddb.db.version()
> 4.7.3 (4, 7, 25)
> bsddb.db.DBEnv().open('/mydir/')
> 

No errors if I run it with python2.6.

Leatri answered 11/4, 2013 at 21:10 Comment(0)
L
0

Yes, BerkeleyDB used to return EINVAL on a version mismatch.

More recent (like last 5+ years) BerkeleyDB returns DB_VERSION_MISMATCH instead.

Loader answered 9/1, 2015 at 18:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.