Copterfly / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Wrong path for WSGIImportScript causes later Python exception in handler. #117

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If /srv/www/mysql.py does not exist in:

WSGIImportScript /srv/www/mysql.py process-group=%{GLOBAL} application-
group=%{GLOBAL}

then later get error:

root@ns1:/srv/www/appwsgi/www/register# tail -f /var/log/apache2/
error.log
[Tue Nov 11 07:08:59 2008] [info] mod_wsgi (pid=24773): Adding '/srv/
www/appwsgi/www/lib' to path.
[Tue Nov 11 07:08:59 2008] [info] mod_wsgi (pid=24773, process='',
application=''): Loading WSGI script '/srv/www/mysql.py'.
[Tue Nov 11 07:08:59 2008] [error] (2)No such file or directory:
mod_wsgi (pid=24773, process='', application=''): Call to fopen()
failed for '/srv/www/mysql.py'.
[Tue Nov 11 07:09:00 2008] [info] [client 80.200.217.89] mod_wsgi
(pid=24769, process='', application=''): Loading WSGI script '/srv/www/
appwsgi/www/register/register.py'., referer:
http://87.98.218.86/appwsgi/www/register/register.htm
[Tue Nov 11 07:09:00 2008] [error] [client 80.200.217.89] mod_wsgi
(pid=24769): Target WSGI script '/srv/www/appwsgi/www/register/
register.py' cannot be loaded as Python module., referer:
http://87.98.218.86/appwsgi/www/register/register.htm
[Tue Nov 11 07:09:00 2008] [error] [client 80.200.217.89] mod_wsgi
(pid=24769): Exception occurred processing WSGI script '/srv/www/
appwsgi/www/register/register.py'., referer:
http://87.98.218.86/appwsgi/www/register/register.htm
[Tue Nov 11 07:09:00 2008] [error] [client 80.200.217.89] Traceback
(most recent call last):, referer: 
http://87.98.218.86/appwsgi/www/register/register.htm
[Tue Nov 11 07:09:00 2008] [error] [client 80.200.217.89]   File "/srv/
www/appwsgi/www/register/register.py", line 3, in <module>, referer:
http://87.98.218.86/appwsgi/www/register/register.htm
[Tue Nov 11 07:09:00 2008] [error] [client 80.200.217.89]     from
xmlframe import xmlframe, referer: 
http://87.98.218.86/appwsgi/www/register/register.htm
[Tue Nov 11 07:09:00 2008] [error] [client 80.200.217.89] IOError:
[Errno 2] No such file or directory, referer:
http://87.98.218.86/appwsgi/www/register/register.htm

This is because Python exception related to failed import is not being cleared.

Need to ensure exception is cleared and possibly first something logged about 
the issue if not already 
done so. Need to check all places where wsgi_load_source() is used.

See:

  http://groups.google.com/group/modwsgi/t/16d14d3672771ced?hl=en

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 16 Nov 2008 at 10:39

GoogleCodeExporter commented 8 years ago
Fixed in revision 1117.

Original comment by Graham.Dumpleton@gmail.com on 17 Nov 2008 at 11:04

GoogleCodeExporter commented 8 years ago
Backported to 2.X for 2.4 in revision r1242.

Original comment by Graham.Dumpleton@gmail.com on 16 Mar 2009 at 10:35

GoogleCodeExporter commented 8 years ago
Version 2.4 of mod_wsgi now released.

Original comment by Graham.Dumpleton@gmail.com on 11 Apr 2009 at 10:25