500 Error Messages - DLL Issue

398 views
Skip to first unread message

cacahootie

unread,
Jun 13, 2011, 8:20:20 PM6/13/11
to isapi_wsgi-dev
Ok - I am getting ready to remove my hair by force on this one.

I am attempting to get CherryPy 3 up and running on IIS 7.5 on Windoze
2k8 R2. I encountered the syntax error issue encountered elsewhere on
this forum and solved by installing the IIS 6 management interface.

I keep getting HTTP 500 errors that I can't really figure out. I have
used a recipe from StackOverflow from Mr. Coombs, the isapi_wsgi
package and isapiwsgihelper and I am getting the same issue from all.

Attempting to run either the test application or a CherryPy hello
world results in:

'Event 4097, ISAPI Filter or Extension'
The pyISAPI extension encountered an error.
Failed to import callback module '_loader'
The last windows error was: The system cannot find the file specified.

I have added the folder in question to the PYTHONPATH and PATH system
(not user) environment variables, and yet I still get this damn
problem. I saw a mention elsewhere, but no resolution.

Any ideas???

Mark Hammond

unread,
Jun 13, 2011, 9:39:07 PM6/13/11
to isapi_w...@googlegroups.com, cacahootie
On 14/06/2011 10:20 AM, cacahootie wrote:
>
> 'Event 4097, ISAPI Filter or Extension'
> The pyISAPI extension encountered an error.
> Failed to import callback module '_loader'
> The last windows error was: The system cannot find the file specified.

This is strange (unless your main entry-point is called "_loader.py").
Assuming it is called "loader.py", this is what *should* happen.

* when registering loader.py, you will wind up with an ISAPI DLL called
'_loader.dll'.

* when this DLL is initialized by IIS, it looks up its own name
("_loader.dll"), strips it down to just the filename portion
("_loader"), then removes the first char (giving "loader") and tries to
import that - it should find the "loader.py" we started with.

If the import failed, you would see the exact message you got, but
without the leading underscore.

The message you got implies to me that you somehow started with
"_loader.py", then registered it (giving __loader.dll). If that is
indeed how things are setup, then I guess you should just make sure the
_loader.py you started with does still exist :)

You could also try using any of the samples that come with pywin32 even
though they aren't WSGI - if they work OK, then it is just something
about your recipe. If they don't, the problem is more fundamental...

HTH,

Mark

cacahootie

unread,
Jun 13, 2011, 11:43:02 PM6/13/11
to isapi_wsgi-dev
> You could also try using any of the samples that come with pywin32 even
> though they aren't WSGI - if they work OK, then it is just something
> about your recipe. If they don't, the problem is more fundamental...

Ok - I have attempted both 'redirect.py' and 'test.py' from the isapi
samples folder. I ran the script in place, it gave me successful
messages, tried to access the root and got 500. Tried copying it into
the content folder, tried setting up the wildcard dll filter
manually. Enabled advanced tracing, and the error I'm now getting is
below:

ModuleName IsapiModule
Notification 128
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 0
ErrorCode 2147942593
ConfigExceptionInfo
Notification EXECUTE_REQUEST_HANDLER
ErrorCode %1 is not a valid Win32 application. (0x800700c1)

I scoured the isapi module for any places that this could have
resulted from and couldn't find anything. I am now not getting the
dll error that I had before, but instead this.

Thanks!
--Brad

Randy Syring

unread,
Jun 14, 2011, 10:25:52 AM6/14/11
to isapi_w...@googlegroups.com
This is a long shot, but are you trying to run a 32 bit DLL in a 64 bit
process (or vice versa)?

--------------------------------------
Randy Syring
Intelicom
Direct: 502-276-0459
Office: 502-212-9913

For the wages of sin is death, but the
free gift of God is eternal life in
Christ Jesus our Lord (Rom 6:23)

Mark Rees

unread,
Jun 25, 2011, 6:34:22 AM6/25/11
to isapi_w...@googlegroups.com
The following solution to a similar problem was posted on the isapi wsgi issue tracker

http://code.google.com/p/isapi-wsgi/issues/detail?id=10

Reply all
Reply to author
Forward
0 new messages