r1114 Call to fopen() failed for '/srv/www/mysql.py'. WSGIImportScript

115 views
Skip to first unread message

gert

unread,
Nov 11, 2008, 1:20:44 AM11/11/08
to modwsgi
I did it again :-) /srv/www/mysql.py does indeed not exist but the
error message takes down the whole wsgipythonpath again

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

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

Graham Dumpleton

unread,
Nov 11, 2008, 5:21:45 AM11/11/08
to mod...@googlegroups.com
No access to source checkout at moment, but in wsgi_python_child_init(), find:

if (!module) {
module = wsgi_load_source(p, NULL, name, exists,
entry->handler_script,
entry->process_group,
entry->application_group);
}

Try changing that to:

if (!module) {
module = wsgi_load_source(p, NULL, name, exists,
entry->handler_script,
entry->process_group,
entry->application_group);

if (PyErr_Occurred())
PyErr_Clear();
}

Fix indenting as necessary.

If works, will fix code later.

Graham

2008/11/11 gert <gert.c...@gmail.com>:

Graham Dumpleton

unread,
Nov 11, 2008, 5:35:04 AM11/11/08
to mod...@googlegroups.com
Hmmm, I wander if the issue:

http://code.google.com/p/modwsgi/issues/detail?id=78

is also somehow related to mod_wsgi not clearing Python exception
state when it wants to ignore the error, this subsequently causing a
problem. For that issue wasn't getting a full error log output, so
don't know full context.

Graham

2008/11/11 Graham Dumpleton <graham.d...@gmail.com>:

gert

unread,
Nov 11, 2008, 1:32:28 PM11/11/08
to modwsgi
yep works also tested WSGIScriptAlias pointing to something that does
not exist

WSGIImportScript /srv/www/bogus.py process-group=%{GLOBAL} application-
group=%{GLOBAL}
WSGIScriptAlias /wsgi /srv/www/bogus.py

[Tue Nov 11 19:25:21 2008] [notice] Apache/2.2.9 (Ubuntu) mod_ssl/
2.2.9 OpenSSL/0.9.8g mod_wsgi/3.0-TRUNK Python/2.5.2 configured --
resuming normal operations
[Tue Nov 11 19:25:21 2008] [info] Server built: Sep 19 2008 13:43:21
[Tue Nov 11 19:25:54 2008] [error] [client 81.240.63.183] File does
not exist: /srv/www/appwsgi/www/wsgi
[Tue Nov 11 19:25:54 2008] [info] mod_wsgi (pid=9781): Attach
interpreter ''.
[Tue Nov 11 19:25:54 2008] [info] mod_wsgi (pid=9781): Adding '/srv/
www/appwsgi/www/lib' to path.
[Tue Nov 11 19:25:54 2008] [info] mod_wsgi (pid=9781, process='',
application=''): Loading WSGI script '/srv/www/mysql.py'.
[Tue Nov 11 19:25:54 2008] [error] (2)No such file or directory:
mod_wsgi (pid=9781, process='', application=''): Call to fopen()
failed for '/srv/www/mysql.py'.
[Tue Nov 11 19:26:24 2008] [error] [client 81.240.63.183] Target WSGI
script not found or unable to stat: /srv/www/wsgi.py
[Tue Nov 11 19:26:54 2008] [info] [client 81.240.63.183] mod_wsgi
(pid=9773, process='', application=''): Loading WSGI script '/srv/www/
appwsgi/www/register/register.py'., referer:
http://91.121.53.159/appwsgi/www/register/register.htm
[Tue Nov 11 19:26:54 2008] [info] [client 81.240.63.183] mod_wsgi
(pid=9773, process='', application=''): Loading WSGI script '/srv/www/
appwsgi/www/download/download.py'., referer:
http://91.121.53.159/appwsgi/www/register/register.htm
[Tue Nov 11 19:27:07 2008] [info] [client 81.240.63.183] mod_wsgi
(pid=9774, process='', application=''): Loading WSGI script '/srv/www/
appwsgi/www/upload2/upload.py'.
[Tue Nov 11 19:27:08 2008] [info] [client 81.240.63.183] mod_wsgi
(pid=9781, process='', application=''): Loading WSGI script '/srv/www/
appwsgi/www/download/download.py'., referer:
http://91.121.53.159/appwsgi/www/register/register.htm
[Tue Nov 11 19:27:08 2008] [info] mod_wsgi (pid=9896): Attach
interpreter ''.
[Tue Nov 11 19:27:08 2008] [info] mod_wsgi (pid=9896): Adding '/srv/
www/appwsgi/www/lib' to path.
[Tue Nov 11 19:27:08 2008] [info] mod_wsgi (pid=9896, process='',
application=''): Loading WSGI script '/srv/www/mysql.py'.
[Tue Nov 11 19:27:08 2008] [error] (2)No such file or directory:
mod_wsgi (pid=9896, process='', application=''): Call to fopen()
failed for '/srv/www/mysql.py'.
[Tue Nov 11 19:30:37 2008] [info] [client 81.240.63.183] mod_wsgi
(pid=9769, process='', application=''): Loading WSGI script '/srv/www/
appwsgi/www/upload2/upload.py'.
[Tue Nov 11 19:30:37 2008] [info] [client 81.240.63.183] mod_wsgi
(pid=9771, process='', application=''): Loading WSGI script '/srv/www/
appwsgi/www/download/download.py'., referer:
http://91.121.53.159/appwsgi/www/register/register.htm

gert

unread,
Nov 11, 2008, 1:36:54 PM11/11/08
to modwsgi
ps what does this mean ?

mod_wsgi.c: In function 'wsgi_log_script_error':
mod_wsgi.c:6727: warning: format not a string literal and no format
arguments

Graham Dumpleton

unread,
Nov 12, 2008, 6:28:50 PM11/12/08
to mod...@googlegroups.com
2008/11/12 gert <gert.c...@gmail.com>:

It means it should be:

ap_log_rerror(APLOG_MARK, WSGI_LOG_ERR(0), r, "%s", message);

I already fixed this in trunk a week or so ago.

------------------------------------------------------------------------
r1108 | Graham.Dumpleton | 2008-11-04 17:56:09 +1100 (Tue, 04 Nov 2008) | 3 line
s

Fix possibility of crash when logging of printf style modifier in
message being logged.

Reply all
Reply to author
Forward
0 new messages