[mod_python] internal error again!

Jim Gallacher jpg at jgassociates.ca
Sat Apr 8 12:25:18 EDT 2006


nemesis128 at atarax.org wrote:
> Hello,
> 
> First i'd like to thank alll the people behind mod_python! =)
> 
> All worked fine for me with apache 1.3.
> Now i have installed apache 2 and i have that usual problem of Internal Server
> Error 500.
> 
> I've read all the faqs about it, nothing works.
> 
> Detailed:
> 
>  - Mandriva Linux 2006
>  - Compiled python 2.4.3
>  - Compiled apache 2.0.55
>  - mod python 3.2.8 (i even tried to compile it with the latest flex 2.5.33)
>  - i tried htaccess & httpd.conf directives
>  - with all examples given in the doc.
>  - i always get the same error log:
> 
> -------------------------------------------------------------------
> [Fri Apr 07 23:19:20 2006] [notice] mod_python: Creating 32 session mutexes
> based on 150 max processes and 0 max threads.
> [Fri Apr 07 23:19:20 2006] [notice] Apache/2.0.55 (Unix) mod_python/3.2.8
> Python/2.4.3 configured -
> - resuming normal operations
> [Fri Apr 07 23:19:23 2006] [error] make_obcallback: could not import
> mod_python.apache.\n
> 'import site' failed; use -v for traceback
> 'import site' failed; use -v for traceback
> ImportError: No module named mod_python.apache
> [Fri Apr 07 23:19:23 2006] [error] python_handler: no interpreter callback
> found.
> [Fri Apr 07 23:19:23 2006] [error] [client ::1] python_handler: Can't get/create
> interpreter., refe
> rer: http://localhost/%7Esm/
> ----------------------------------------------------------------------

Since you compiled your own python and apache, I going to assume that 
you have multiple versions of each on your system.

Quoting from Graham,
"Having multiple versions of Python available can often be a problem as
Apache/mod_python will attempt to use the one found in $PATH of user 
Apache is started as and not that which mod_python was compiled against. 
This can result in a unhealthy mix of stuff from different versions of 
Python being used."

> Well, sys.path is OK too, but cannot import site (nor mod_python) !!
> 
> 
> I also get that kind of error on apache startup sometimes, and i just don't know
> if it has something to do with the problem explained above:
> 
> ----------------------------------------------------------------------
> [Sat Apr 08 02:13:37 2006] [notice] mod_python: Creating 32 session mutexes
> based on 150 max proces
> ses and 0 max threads.
> [Sat Apr 08 02:13:37 2006] [error] (28)No space left on device: mod_python:
> Failed to create global
>  mutex 21 of 32 (/tmp/mpmtx1145121).
> [Sat Apr 08 02:13:37 2006] [error] mod_python: We can probably continue, but
> with diminished abilit
> y to process session locks.
> [Sat Apr 08 02:13:37 2006] [error] mod_python: Hint: On Linux, the problem may
> be the number of ava
> ilable semaphores, check 'sysctl kernel.sem'
> [Sat Apr 08 02:13:37 2006] [notice] Apache/2.0.55 (Unix) mod_python/3.2.8
> Python/2.4.3 configured -
> - resuming normal operations
> -------------------------------------------------------------------------

This may be the result of Apache not shutting down cleanly. Normally it 
will remove the semaphores but if things are badly borked this may not 
happen. You can remove the dead semaphores by running the following 
command as root, subsituting the correct apache user for "apache-user":

localhost:~# ipcs -s | awk '/apache-user/ { system("ipcrm sem " $2) }'

Also, you likely don't need 32 mutexes. I'd stick with the default of 8 
until you've done some benchmarking to prove that you really do need 32.

Jim










More information about the Mod_python mailing list