bsddb 4.2.52 DBInvalidArgError 22 Invalid argument

萝らか妹 提交于 2019-12-08 08:43:20

问题


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.


回答1:


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

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



来源:https://stackoverflow.com/questions/15958917/bsddb-4-2-52-dbinvalidargerror-22-invalid-argument

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!