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

Chris McDonough chrism@zope.com
Wed Apr 16 12:40:03 EDT 2003


It sounds like it didn't import the db module, which makes me think that
pybsddb isn't installed properly.  Maybe your ZEO is using a different
Python than the one you installed pybsddb into?  Can you run the Python
interpreter that your ZEO uses and try:

from dbsddb3 import db



On Wed, 2003-04-16 at 04:19, Harald Ragger wrote:
> Hi,
> 
> Im using python 2.2.2 pybsddb 3-4.1.3 BDB 4.1.25 (+sleepycat patch)
> 
> running zeo:
> -----
> #!/bin/sh
> # ZEO instance start script
> PYTHON="/usr/local/bin/python"
> ZOPE_HOME="/opt/Zope/lib/python"
> INSTANCE_HOME="/opt/zeo3"
> CONFIG_FILE="$INSTANCE_HOME/etc/zeo.conf"
> PYTHONPATH="$ZOPE_HOME"
> export PYTHONPATH
> ZEO_RUN="$ZOPE_HOME/ZEO/runzeo.py"
> exec "$PYTHON" "$ZEO_RUN" -C "$CONFIG_FILE" ${1+"$@"}
> ------
> 
> with zeo-conf snip
> -----------------------
> .....
> <fullstorage 3>
>     name test-db
>     interval 2m
>     logdir /opt/zeo3/log
>     cachesize 128MB
> </fullstorage>
> ....
> ---------------------
> 
> gives:
> ----------------------------
> Traceback (most recent call last):
>   File "/opt/Zope/lib/python/ZEO/runzeo.py", line 295, in ?
>     main()
>   File "/opt/Zope/lib/python/ZEO/runzeo.py", line 292, in main
>     s.main()
>   File "/opt/Zope/lib/python/ZEO/runzeo.py", line 116, in main
>     self.open_storages()
>   File "/opt/Zope/lib/python/ZEO/runzeo.py", line 162, in open_storages
>     self.storages[opener.name] = opener.open()
>   File "/opt/Zope/lib/python/ZODB/config.py", line 137, in open
>     return storageclass(self.config.name, config=bconf)
>   File "/opt/Zope/lib/python/BDBStorage/BerkeleyBase.py", line 201, in 
> __init__
>     self._env, self._lockfile = env_from_string(env, self._config)
>   File "/opt/Zope/lib/python/BDBStorage/BerkeleyBase.py", line 472, in 
> env_from_string
>     env = db.DBEnv()
> AttributeError: 'NoneType' object has no attribute 'DBEnv'
> --------------
> 
> do i miss a key in the config-file ?
> 
> Thanks,
> Harry
> 
> 
> 
> 
> On Tuesday 15 April 2003 17:22, Barry Warsaw wrote:
> > 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