[mod_python] The Session problem with mod_python3.2.7

Graham Dumpleton grahamd at dscpl.com.au
Tue Feb 21 05:03:13 EST 2006


Please keep posts on the mailing list.

On 21/02/2006, at 5:41 PM, Gavin wrote:

> hello Graham
>
> Thank you!
> My configuration is as following:
>
> <Directory "/data/HTTPD/htdocs/FeedBack">
>
>   AddHandler mod_python  .m

Do you really mean ".m"? Don't you mean ".psp, how else can you use  
"sid.psp"
as file name?

>   PythonHandler mod_python.psp
>   #PythonHandler mod_python.publisher
>   PythonPath "['/data/HTTPD/py_api']+['/data/HTTPD/htdocs/FeedBack'] 
> +sys.path"
>   PythonDebug Off
>   Options Indexes FollowSymLinks
>   Order deny,allow
>   Allow from all
>
> </Directory>
>
> I don't use PythonOption to override the either "session_dbm" or  
> "session_directory"

All I can suggest then is to look for the file:

   /tmp/mp_sess.dbm.db

or something named similarly. I don't think it is meant to have extra  
".db" extension
but on my Mac there is one for some reason.

This is the DBM session database. It may have somehow got corrupted.  
If you don't
have a main Apache process that is still trying to use it, remove it  
and start over.

You could also put in your Apache configuration:

   PythonOption session_dbm /tmp/mp_sess_test.dbm

Then return your test. Because it will be a fresh database, if it  
works, may again
show that default database is corrupt.

Graham


> Sincerely,
>
> Frank Ning
>
>
>
> ----- Original Message -----
> From: "Graham Dumpleton" <grahamd at dscpl.com.au>
> To: "Gavin" <gavin at sz.net.cn>
> Cc: "mod_python" <mod_python at modpython.org>
> Sent: Tuesday, February 21, 2006 11:06 AM
> Subject: Re: [mod_python] The Session problem with mod_python3.2.7
>
>
> Gavin wrote ..
>> ...
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp:   File "/usr/local/lib/python2.4/site-packages/ 
>> mod_python/Session.py",
>> line 188, in load\n    dict = self.do_load()
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp:   File "/usr/local/lib/python2.4/site-packages/ 
>> mod_python/Session.py",
>> line 321, in do_load\n    dbm = self._get_dbm()
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp:   File "/usr/local/lib/python2.4/site-packages/ 
>> mod_python/Session.py",
>> line 308, in _get_dbm\n    result = self._dbmtype.open 
>> (self._dbmfile, 'c')
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp:   File "/usr/local/lib/python2.4/anydbm.py", line  
>> 83, in
>> open\n    return mod.open(file, flag, mode)
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp:   File "/usr/local/lib/python2.4/dbhash.py", line  
>> 16, in
>> open\n    return bsddb.hashopen(file, flag, mode)
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp:   File "/usr/local/lib/python2.4/bsddb/ 
>> __init__.py", line
>> 285, in hashopen\n    e = _openDBEnv()
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp:   File "/usr/local/lib/python2.4/bsddb/ 
>> __init__.py", line
>> 339, in _openDBEnv\n    e.open('.', db.DB_PRIVATE | db.DB_CREATE |  
>> db.DB_THREAD
>> | db.DB_INIT_LOCK | db.DB_INIT_MPOOL)
>> [Tue Feb 21 10:30:18 2006] [error] [client 202.104.96.163]  
>> PythonHandler
>> mod_python.psp: DBError: (138044656, 'Unknown error 138044656')
>
> That the first argument to the open() call is '.' doesn't look  
> correct. This
> should from what I can tell be set to the value of self._dbmfile,  
> which is
> determined by code:
>
>     def __init__(self, req, dbm=None, sid=0, secret=None,  
> dbmtype=anydbm, timeout=0, lock=1):
>         if not dbm:
>             opts = req.get_options()
>             if opts.has_key("session_dbm"):
>                 dbm = opts["session_dbm"]
>             else:
>                 dbm = os.path.join(opts.get('session_directory',  
> tempdir), 'mp_sess.dbm')
>
>         self._dbmfile = dbm
>
> Have you used PythonOption to override either "session_dbm" or  
> "session_directory"?
>
> Graham



More information about the Mod_python mailing list