AW: [ZODB-Dev] zope.conf question...
Harald Ragger
harald.ragger@icomedias.com
Wed Apr 16 13:13:33 EDT 2003
Hi,
you are right, the problem was a wrong configured bsddb3 module.
Thanks a lot,
Harry
-----Urspr=FCngliche Nachricht-----
Von: Chris McDonough [mailto:chrism@zope.com]
Gesendet: Mittwoch, 16. April 2003 13:40
An: Harald Ragger
Cc: zodb-dev@zope.org; Barry Warsaw
Betreff: Re: [ZODB-Dev] zope.conf question...
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,
>=20
> Im using python 2.2.2 pybsddb 3-4.1.3 BDB 4.1.25 (+sleepycat patch)
>=20
> running zeo:
> -----
> #!/bin/sh
> # ZEO instance start script
> PYTHON=3D"/usr/local/bin/python"
> ZOPE_HOME=3D"/opt/Zope/lib/python"
> INSTANCE_HOME=3D"/opt/zeo3"
> CONFIG_FILE=3D"$INSTANCE_HOME/etc/zeo.conf"
> PYTHONPATH=3D"$ZOPE_HOME"
> export PYTHONPATH
> ZEO_RUN=3D"$ZOPE_HOME/ZEO/runzeo.py"
> exec "$PYTHON" "$ZEO_RUN" -C "$CONFIG_FILE" ${1+"$@"}
> ------
>=20
> with zeo-conf snip
> -----------------------
> .....
> <fullstorage 3>
> name test-db
> interval 2m
> logdir /opt/zeo3/log
> cachesize 128MB
> </fullstorage>
> ....
> ---------------------
>=20
> 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] =3D opener.open()
> File "/opt/Zope/lib/python/ZODB/config.py", line 137, in open
> return storageclass(self.config.name, config=3Dbconf)
> File "/opt/Zope/lib/python/BDBStorage/BerkeleyBase.py", line 201, in =
> __init__
> self._env, self._lockfile =3D env_from_string(env, self._config)
> File "/opt/Zope/lib/python/BDBStorage/BerkeleyBase.py", line 472, in =
> env_from_string
> env =3D db.DBEnv()
> AttributeError: 'NoneType' object has no attribute 'DBEnv'
> --------------
>=20
> do i miss a key in the config-file ?
>=20
> Thanks,
> Harry
>=20
>=20
>=20
>=20
> 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=3Dsrc 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 =3D BerkeleyConfig()
> > >>> c.logdir =3D '/tmp/bad'
> > >>> from zodb.storage.bdbfull import BDBFullStorage
> > >>> f =3D BDBFullStorage('baz', config=3Dc)
> >
> > 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 =3D 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 =3D '/tmp'
> > >>> f =3D BDBFullStorage('baz', config=3Dc)
> >
> > 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
>=20
More information about the ZODB-Dev
mailing list