[ZODB-Dev] zope.conf question...

Barry Warsaw barry@python.org
Tue Apr 15 16:22:04 EDT 2003


On Tue, 2003-04-15 at 10:57, Chris McDonough wrote:
> I lied.  I just experienced the error you did, which was not a setup
> error.
> 
> It happens in BerkeleyBase.py's 'env_from_string' function, in the call
> to env.open().  During the call to this function, it exits (seemingly
> cleanly) after creating some __db.00X files within test-db in the
> instance home.
> 
> It happened, in my case, because I did not have write access to the
> directory I named within the "logdir" key in the fullstorage.  Once I
> changed that directory name to a place which I could write to, it began
> to work.  Something in the bsddb C code must call exit() (or perhaps
> even crash) instead of propagating an exception up to the Python code in
> this case.  I'm not quite sure how to make it behave better.
> 
> I used Python 2.2.2 with pybsddb3-4.1.3 against BerkeleyDB 4-4.0.14.

Okay, I just tested this with Python 2.2.2, PyBSDDB 4.1.3, BerkeleyDB
4.1.25, and Zope 3 cvs (ZODB 4):

% PYTHONPATH=src python
Python 2.2.2 (#1, Oct 15 2002, 12:24:47) 
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bsddb3
>>> bsddb3.__version__
'4.1.3'
>>> bsddb3.db.version()
(4, 1, 25)
>>> from zodb.storage.base import BerkeleyConfig
>>> c = BerkeleyConfig()
>>> c.logdir = '/tmp/bad'
>>> from zodb.storage.bdbfull import BDBFullStorage
>>> f = BDBFullStorage('baz', config=c)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/barry/projects/zope3/src/zodb/storage/base.py", line 517,
in __init__
    self._env, self._lockfile = self._newenv(envdir)
  File "/home/barry/projects/zope3/src/zodb/storage/base.py", line 571,
in _newenv
    return env_from_string(envdir, self._config)
  File "/home/barry/projects/zope3/src/zodb/storage/base.py", line 799,
in env_from_string
    db.DB_CREATE          # create underlying files as necessary
bsddb._db.DBRunRecoveryError: (-30982, 'DB_RUNRECOVERY: Fatal error, run
database recovery -- PANIC: DB_RUNRECOVERY: Fatal error, run database
recovery')
>>> c.logdir = '/tmp'    
>>> f = BDBFullStorage('baz', config=c)

So it doesn't crash for me.  I get a reasonable error from pybsddb. 
Perhaps this is a bug with BerkeleyDB 4.0.14?

<click, type, mull>

Yep.  From the BerkeleyDB 4.1.24 ChangeLog:

Fix a bug where creating a database environment with a non-existent
logging directory could drop core. [#5833]

So upgrading to BerkeleyDB 4.1.25 should fix your problem.  Note that
there is one released patch for 4.1.25 but it shouldn't affect our
BerkeleyDB storages.

-Barry






More information about the ZODB-Dev mailing list