RE: mod_python import failure on FreeBSD AMD64

Surly The Clown <[email protected]> Tue, 4 May 2010 19:53:29 -0700
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
--===============2131710964==
Content-Type: multipart/alternative;
	boundary="_52ba1729-2665-4ee4-b63b-4c8b6aaf3df1_"

--_52ba1729-2665-4ee4-b63b-4c8b6aaf3df1_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


















> Date: Wed=2C 5 May 2010 09:30:10 +1000
> Subject: Re: [mod_python] mod_python import failure on FreeBSD AMD64
> From: [email protected]
> To: [email protected]
> CC: [email protected]
>=20
> On 5 May 2010 09:12=2C Surly The Clown <[email protected]> wrot=
e:
> > Hello all=2C
> >
> >
> > I have two FreeBSD machines=2C both running the latest FreeBSD-8.0 rele=
ase=2C
> > apache-2.2.14_6=2C and mod_python-3.3.1_2. On one of the machines=2C th=
e i386
> > one=2C there are no problems. Everything works fine. On the other one=
=2C an
> > AMD64 machine=2C any attempt to access a page handled by mod_python res=
ults in
> > a 500 Internal Server Error response and the following error log:
> >
> >
> > [Tue May 04 14:41:34 2010] [notice] mod_python: Creating 8 session mute=
xes
> > based on 256 max processes and 0 max threads.
> > [Tue May 04 14:41:34 2010] [notice] mod_python: using mutex_directory /=
tmp
> > [Tue May 04 14:41:34 2010] [notice] Apache/2.2.14 (FreeBSD) mod_python/=
3.3.1
> > Python/2.6.4 configured -- resuming normal operations
> > sem_init: No space left on device
>=20
> The first problem is that you don't have enough SYSV semaphores
> configured for your system.
>=20
> You can try setting:
>=20
>   PythonOption mod_python.mutex_locks 4
>=20
> to reduce number used=2C but you still may not have enough.
>=20
> Try fixing that first using that option=2C or by increasing number of
> semaphores in kernel configuration.
>=20
> Graham



Thank you very much for responding. The lack of activity on this mailing li=
st had me thinking no one used it anymore.

I tried setting PythonOption mod_python.mutex_locks 4=2C and the problem pe=
rsisted. I then tried increasing the number of available semaphores in the =
kernel from the default 10 (!) to 256=2C verified that that setting had cha=
nged=2C and then tried again. The problem still persists. Furthermore=2C fo=
ur files that appear to be the mutexes exist in /tmp=2C named mpmtx15570 to=
 mpmtx15573. Perhaps mod_python isn't using kernel semaphores? Its document=
ation says that it doesn't always. And /tmp isn't out of space (no partitio=
n is).

Any more ideas?

Error log:

[Tue May 04 19:42:14 2010] [notice] mod_python: Creating 4 session mutexes =
based on 256 max processes and 0 max threads.
[Tue May 04 19:42:14 2010] [notice] mod_python: using mutex_directory /tmp
[Tue May 04 19:42:14 2010] [notice] Apache/2.2.14 (FreeBSD) mod_python/3.3.=
1 Python/2.6.4 configured -- resuming normal operations
sem_init: No space left on device
[Tue May 04 19:42:15 2010] [error] make_obcallback: could not import mod_py=
thon.apache.\n
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/site-packages/mod_python/apache.py"=2C lin=
e 29=2C in <module>
    import cgi
  File "/usr/local/lib/python2.6/cgi.py"=2C line 40=2C in <module>
    import urllib
  File "/usr/local/lib/python2.6/urllib.py"=2C line 26=2C in <module>
    import socket
  File "/usr/local/lib/python2.6/socket.py"=2C line 64=2C in <module>
    from _ssl import SSLError as sslerror
ImportError: cannot import name SSLError
[Tue May 04 19:42:15 2010] [error] make_obcallback: Python path being used =
"['/usr/local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg'=2C '=
/usr/local/lib/python2.6/site-packages/nose-0.11.1-py2.6.egg'=2C '/usr/loca=
l/lib/python26.zip'=2C '/usr/local/lib/python2.6'=2C '/usr/local/lib/python=
2.6/plat-freebsd8'=2C '/usr/local/lib/python2.6/lib-tk'=2C '/usr/local/lib/=
python2.6/lib-old'=2C '/usr/local/lib/python2.6/lib-dynload'=2C '/usr/local=
/lib/python2.6/site-packages'=2C '/usr/local/lib/python2.6/site-packages/Nu=
meric'=2C '/usr/local/lib/python2.6/site-packages/gtk-2.0']".
[Tue May 04 19:42:15 2010] [error] get_interpreter: no interpreter callback=
 found.
[Tue May 04 19:42:15 2010] [error] [client 192.168.123.106] python_handler:=
 Can't get/create interpreter.
[Tue May 04 19:42:15 2010] [error] [client 192.168.123.106] File does not e=
xist: /usr/home/chrisa/test/favicon.ico=2C referer: http://192.168.123.136:=
8080/fetch.py

httpd.conf:

ServerRoot "/usr/local"

Listen 8080
LoadModule deflate_module libexec/apache22/mod_deflate.so
LoadModule log_config_module libexec/apache22/mod_log_config.so
LoadModule mime_magic_module libexec/apache22/mod_mime_magic.so
LoadModule unique_id_module libexec/apache22/mod_unique_id.so
LoadModule mime_module libexec/apache22/mod_mime.so
LoadModule dir_module libexec/apache22/mod_dir.so
LoadModule authz_host_module libexec/apache22/mod_authz_host.so
LoadModule python_module libexec/apache22/mod_python.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User www
Group www
</IfModule>
</IfModule>
ServerAdmin [email protected]
ServerName 192.168.123.136:8080
DocumentRoot "/usr/home/chrisa/test"
PythonOption mod_python.mutex_locks 4
<Directory />
    AllowOverride None
    Options None
    Order deny=2Callow
    Deny from all
</Directory>
<Directory "/usr/home/chrisa/test">
    Options None
    DirectoryIndex index.html
    AddHandler mod_python .py .php .html .swf .pdf .js
    PythonHandler fetch
    PythonDebug On
    AllowOverride None
    Order allow=2Cdeny
    Allow from all
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
<FilesMatch "^\.ht">
    Order allow=2Cdeny
    Deny from all
    Satisfy All
</FilesMatch>
ErrorLog "/var/log/httpd-error.log"
LogLevel warn
<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"=
" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i=
\" %I %O" combinedio
    </IfModule>
    CustomLog "/var/log/httpd-access.log" combined
</IfModule>
DefaultType text/plain
<IfModule mime_module>
    TypesConfig etc/apache22/mime.types
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
</IfModule>




 		 	   		 =20
_________________________________________________________________
Win a $10=2C000 shopping spree from Hotmail! Enter now.
http://go.microsoft.com/?linkid=3D9729711=

--_52ba1729-2665-4ee4-b63b-4c8b6aaf3df1_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 10pt=3B
font-family:Verdana
}
--></style>
</head>
<body class=3D'hmmessage'>


<META http-equiv=3D"Content-Type" content=3D"text/html=3B charset=3Dunicode=
">
<META name=3D"Generator" content=3D"Microsoft SafeHTML">
<STYLE>
.hmmessage P
{margin:0px=3Bpadding:0px=3B}
body.hmmessage
{font-size:10pt=3Bfont-family:Verdana=3B}

</STYLE>





<STYLE>
.hmmessage P
{margin:0px=3Bpadding:0px=3B}
body.hmmessage
{font-size:10pt=3Bfont-family:Verdana=3B}
</STYLE>





<STYLE>
.hmmessage P
{margin:0px=3Bpadding:0px=3B}
body.hmmessage
{font-size:10pt=3Bfont-family:Verdana=3B}
</STYLE>&gt=3B Date: Wed=2C 5 May 2010 09:30:10 +1000<BR>&gt=3B Subject: Re=
: [mod_python] mod_python import failure on FreeBSD AMD64<BR>&gt=3B From: g=
[email protected]<BR>&gt=3B To: [email protected]<BR>&gt=
=3B CC: [email protected]<BR>&gt=3B <BR>&gt=3B On 5 May 2010 09:12=
=2C Surly The Clown &[email protected]&gt=3B wrote:<BR>&gt=
=3B &gt=3B Hello all=2C<BR>&gt=3B &gt=3B<BR>&gt=3B &gt=3B<BR>&gt=3B &gt=3B =
I have two FreeBSD machines=2C both running the latest FreeBSD-8.0 release=
=2C<BR>&gt=3B &gt=3B apache-2.2.14_6=2C and mod_python-3.3.1_2. On one of t=
he machines=2C the i386<BR>&gt=3B &gt=3B one=2C there are no problems. Ever=
ything works fine. On the other one=2C an<BR>&gt=3B &gt=3B AMD64 machine=2C=
 any attempt to access a page handled by mod_python results in<BR>&gt=3B &g=
t=3B a 500 Internal Server Error response and the following error log:<BR>&=
gt=3B &gt=3B<BR>&gt=3B &gt=3B<BR>&gt=3B &gt=3B [Tue May 04 14:41:34 2010] [=
notice] mod_python: Creating 8 session mutexes<BR>&gt=3B &gt=3B based on 25=
6 max processes and 0 max threads.<BR>&gt=3B &gt=3B [Tue May 04 14:41:34 20=
10] [notice] mod_python: using mutex_directory /tmp<BR>&gt=3B &gt=3B [Tue M=
ay 04 14:41:34 2010] [notice] Apache/2.2.14 (FreeBSD) mod_python/3.3.1<BR>&=
gt=3B &gt=3B Python/2.6.4 configured -- resuming normal operations<BR>&gt=
=3B &gt=3B sem_init: No space left on device<BR>&gt=3B <BR>&gt=3B The first=
 problem is that you don't have enough SYSV semaphores<BR>&gt=3B configured=
 for your system.<BR>&gt=3B <BR>&gt=3B You can try setting:<BR>&gt=3B <BR>&=
gt=3B   PythonOption mod_python.mutex_locks 4<BR>&gt=3B <BR>&gt=3B to reduc=
e number used=2C but you still may not have enough.<BR>&gt=3B <BR>&gt=3B Tr=
y fixing that first using that option=2C or by increasing number of<BR>&gt=
=3B semaphores in kernel configuration.<BR>&gt=3B <BR>&gt=3B Graham<BR><BR>

Thank you very much for responding. The lack of activity on this mailing li=
st had me thinking no one used it anymore.<BR><BR>I tried setting PythonOpt=
ion mod_python.mutex_locks 4=2C and the problem persisted. I then tried inc=
reasing the number of available semaphores in the kernel from the default 1=
0 (!) to 256=2C verified that that setting had changed=2C and then tried ag=
ain. The problem still persists. Furthermore=2C four files that appear to b=
e the mutexes exist in /tmp=2C named mpmtx15570 to mpmtx15573. Perhaps mod_=
python isn't using kernel semaphores? Its documentation says that it doesn'=
t always. And /tmp isn't out of space (no partition is).<BR><BR>Any more id=
eas?<BR><BR>Error log:<BR><BR>[Tue May 04 19:42:14 2010] [notice] mod_pytho=
n: Creating 4 session mutexes based on 256 max processes and 0 max threads.=
<BR>[Tue May 04 19:42:14 2010] [notice] mod_python: using mutex_directory /=
tmp<BR>[Tue May 04 19:42:14 2010] [notice] Apache/2.2.14 (FreeBSD) mod_pyth=
on/3.3.1 Python/2.6.4 configured -- resuming normal operations<BR>sem_init:=
 No space left on device<BR>[Tue May 04 19:42:15 2010] [error] make_obcallb=
ack: could not import mod_python.apache.\n<BR>Traceback (most recent call l=
ast):<BR>  File "/usr/local/lib/python2.6/site-packages/mod_python/apache.p=
y"=2C line 29=2C in &lt=3Bmodule&gt=3B<BR>    import cgi<BR>  File "/usr/lo=
cal/lib/python2.6/cgi.py"=2C line 40=2C in &lt=3Bmodule&gt=3B<BR>    import=
 urllib<BR>  File "/usr/local/lib/python2.6/urllib.py"=2C line 26=2C in &lt=
=3Bmodule&gt=3B<BR>    import socket<BR>  File "/usr/local/lib/python2.6/so=
cket.py"=2C line 64=2C in &lt=3Bmodule&gt=3B<BR>    from _ssl import SSLErr=
or as sslerror<BR>ImportError: cannot import name SSLError<BR>[Tue May 04 1=
9:42:15 2010] [error] make_obcallback: Python path being used "['/usr/local=
/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg'=2C '/usr/local/li=
b/python2.6/site-packages/nose-0.11.1-py2.6.egg'=2C '/usr/local/lib/python2=
6.zip'=2C '/usr/local/lib/python2.6'=2C '/usr/local/lib/python2.6/plat-free=
bsd8'=2C '/usr/local/lib/python2.6/lib-tk'=2C '/usr/local/lib/python2.6/lib=
-old'=2C '/usr/local/lib/python2.6/lib-dynload'=2C '/usr/local/lib/python2.=
6/site-packages'=2C '/usr/local/lib/python2.6/site-packages/Numeric'=2C '/u=
sr/local/lib/python2.6/site-packages/gtk-2.0']".<BR>[Tue May 04 19:42:15 20=
10] [error] get_interpreter: no interpreter callback found.<BR>[Tue May 04 =
19:42:15 2010] [error] [client 192.168.123.106] python_handler: Can't get/c=
reate interpreter.<BR>[Tue May 04 19:42:15 2010] [error] [client 192.168.12=
3.106] File does not exist: /usr/home/chrisa/test/favicon.ico=2C referer: h=
ttp://192.168.123.136:8080/fetch.py<BR><BR>httpd.conf:<BR><BR>ServerRoot "/=
usr/local"<BR><BR>Listen 8080<BR>LoadModule deflate_module libexec/apache22=
/mod_deflate.so<BR>LoadModule log_config_module libexec/apache22/mod_log_co=
nfig.so<BR>LoadModule mime_magic_module libexec/apache22/mod_mime_magic.so<=
BR>LoadModule unique_id_module libexec/apache22/mod_unique_id.so<BR>LoadMod=
ule mime_module libexec/apache22/mod_mime.so<BR>LoadModule dir_module libex=
ec/apache22/mod_dir.so<BR>LoadModule authz_host_module libexec/apache22/mod=
_authz_host.so<BR>LoadModule python_module libexec/apache22/mod_python.so<B=
R>&lt=3BIfModule !mpm_netware_module&gt=3B<BR>&lt=3BIfModule !mpm_winnt_mod=
ule&gt=3B<BR>User www<BR>Group www<BR>&lt=3B/IfModule&gt=3B<BR>&lt=3B/IfMod=
ule&gt=3B<BR>ServerAdmin [email protected]<BR>ServerName 192.168.123.136:8080=
<BR>DocumentRoot "/usr/home/chrisa/test"<BR>PythonOption mod_python.mutex_l=
ocks 4<BR>&lt=3BDirectory /&gt=3B<BR>    AllowOverride None<BR>    Options =
None<BR>    Order deny=2Callow<BR>    Deny from all<BR>&lt=3B/Directory&gt=
=3B<BR>&lt=3BDirectory "/usr/home/chrisa/test"&gt=3B<BR>    Options None<BR=
>    DirectoryIndex index.html<BR>    AddHandler mod_python .py .php .html =
.swf .pdf .js<BR>    PythonHandler fetch<BR>    PythonDebug On<BR>    Allow=
Override None<BR>    Order allow=2Cdeny<BR>    Allow from all<BR>&lt=3B/Dir=
ectory&gt=3B<BR>&lt=3BIfModule dir_module&gt=3B<BR>    DirectoryIndex index=
.html<BR>&lt=3B/IfModule&gt=3B<BR>&lt=3BFilesMatch "^\.ht"&gt=3B<BR>    Ord=
er allow=2Cdeny<BR>    Deny from all<BR>    Satisfy All<BR>&lt=3B/FilesMatc=
h&gt=3B<BR>ErrorLog "/var/log/httpd-error.log"<BR>LogLevel warn<BR>&lt=3BIf=
Module log_config_module&gt=3B<BR>    LogFormat "%h %l %u %t \"%r\" %&gt=3B=
s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined<BR>    LogFormat "%h %l %=
u %t \"%r\" %&gt=3Bs %b" common<BR>    &lt=3BIfModule logio_module&gt=3B<BR=
>      LogFormat "%h %l %u %t \"%r\" %&gt=3Bs %b \"%{Referer}i\" \"%{User-A=
gent}i\" %I %O" combinedio<BR>    &lt=3B/IfModule&gt=3B<BR>    CustomLog "/=
var/log/httpd-access.log" combined<BR>&lt=3B/IfModule&gt=3B<BR>DefaultType =
text/plain<BR>&lt=3BIfModule mime_module&gt=3B<BR>    TypesConfig etc/apach=
e22/mime.types<BR>    AddEncoding x-compress .Z<BR>    AddEncoding x-gzip .=
gz .tgz<BR>&lt=3B/IfModule&gt=3B<BR><BR>


 		 	   		  <br /><hr />Win a $10=2C000 shopping spree from Hotmail! Enter =
now <a href=3D'http://go.microsoft.com/?linkid=3D9729706' target=3D'_new'>E=
nter now</a></body>
</html>=

--_52ba1729-2665-4ee4-b63b-4c8b6aaf3df1_--

--===============2131710964==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Mod_python mailing list
[email protected]
http://mailman.modpython.org/mailman/listinfo/mod_python

--===============2131710964==--