[mod_python] PSP and Session Probelms

Jim Gallacher jg.lists at sympatico.ca
Wed Jun 1 11:02:27 EDT 2005


Try restarting apache and run the following test handler:

import _apache

def handler(req):
     req.content_type = 'text/plain'
     req.write('begin lock test\n')
     _apache._global_lock(req.server, None, 0)
     _apache._global_unlock(req.server, None, 0)
     req.write('begin lock test\n')
     return apache.OK

Check the apache error.log and post any errors (including apache 
startup) regarding mutexes or locks.

Regards,
Jim


Asif Jan wrote:
> By the way I get same error when using the python scripts as well
> 
> Mod_python error: "PythonHandler mod_python.publisher"
> 
> Traceback (most recent call last):
> 
>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-packages/mod_python/apache.py", line 299, in  
> HandlerDispatch
>     result = object(req)
> 
>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-packages/mod_python/publisher.py", line 136, in handler
>     result = util.apply_fs_data(object, req.form, req=req)
> 
>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-packages/mod_python/util.py", line 361, in apply_fs_data
>     return object(**args)
> 
>   File "/Library/Apache2/htdocs/NEOBASE/mptest.py", line 5, in test
>     sess = Session.Session(req)
> 
>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-packages/mod_python/Session.py", line 389, in Session
>     timeout=timeout, lock=lock)
> 
>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-packages/mod_python/Session.py", line 294, in __init__
>     timeout=timeout, lock=lock)
> 
>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-packages/mod_python/Session.py", line 131, in __init__
>     self.lock()                 # lock new sid
> 
>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-packages/mod_python/Session.py", line 215, in lock
>     _apache._global_lock(self._req.server, self._sid)
> 
> ValueError: Failed to acquire global mutex lock
> On Jun 1, 2005, at 3:17 PM, Asif Jan wrote:
> 
>>
>> Hi ,
>>
>> When I try to use "session" object inside a PSP page I get following  
>> error  ( I am using Mac OS X 10.3.9 , Python 2.3 (Apple), and  
>> mod_python 3.1.4).
>>
>> Is it something specific to Mac OS X ?
>>
>> By the way in my psp page I am doing a very simple thing i.e.
>>
>> if not session.is_new():
>>     #  do something
>> else:
>>     # do something else
>>
>>
>> Mod_python error: "PythonHandler mod_python.psp"
>>
>> Traceback (most recent call last):
>>
>>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/site-packages/mod_python/apache.py", line 299, in  
>> HandlerDispatch
>>     result = object(req)
>>
>>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/site-packages/mod_python/psp.py", line 297, in handler
>>     p.run()
>>
>>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/site-packages/mod_python/psp.py", line 191, in run
>>     session = Session.Session(req)
>>
>>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/site-packages/mod_python/Session.py", line 389, in Session
>>     timeout=timeout, lock=lock)
>>
>>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/site-packages/mod_python/Session.py", line 294, in __init__
>>     timeout=timeout, lock=lock)
>>
>>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/site-packages/mod_python/Session.py", line 131, in __init__
>>     self.lock()                 # lock new sid
>>
>>   File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/site-packages/mod_python/Session.py", line 215, in lock
>>     _apache._global_lock(self._req.server, self._sid)
>>
>> ValueError: Failed to acquire global mutex lock
>>
>> _______________________________________________
>> Mod_python mailing list
>> Mod_python at modpython.org
>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>
>>
> Asif Jan
> Research Assistant
> Brain Mind Institute
> Ecole Polytechnique Federale De Lausanne (EPFL)
> Lausanne Switzerland
> 
> Tel +41216939529
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
> 



More information about the Mod_python mailing list