URL Rewrite, isapi-wsgi 500 errors

63 views
Skip to first unread message

Jason

unread,
May 14, 2012, 6:55:44 PM5/14/12
to isapi_w...@googlegroups.com
I'd like to mount a couple django apps under an existing website. I can get isapi_wsgi mounted correctly, i.e. /django/myapp works just fine. I'd like to have just /myapp instead, so enter URL Rewrite. The plan is to map /myapp to /django/myapp.

The problem is that with even a single rule enabled, e.g. /test.css rewritten as /css/test.css, /django/myapp now gives a 500 error. Rule off, works again. No clues (as in, no information logged from the 500 error at all) found via win32traceutil, failed request logging, or event viewer.

Finally, after some permutation I've got my site/app-pool completely snafu'd and not even isapi-wsgi-demo will work. /django/myapp and isapi-wsgi-demo still work on my default site but I can't detect the difference that's causing my other site to barf. To me this smells like something that might require a manual config file cleanup somewhere - multiple installs stepping on things (e.g. pyisapie), something in the wrong order. I haven't been able to find good documentation that shows me where to look - IIS doesn't seem to have a lot between the barest basics and low-level autogenerated stuff that's of no help.

IIS 7.5, Python 2.7 64-bit.

Any guesses? Tips on where to look?

Feel free to mail me directly.

P.S. not sure this is relevant but on running isapi-wsgi-demo I saw this trace output:

Traceback (most recent call last):
  File "C:\Python27\Lib\wsgiref\handlers.py", line 86, in run
    self.finish_response()
  File "C:\Python27\Lib\wsgiref\handlers.py", line 126, in finish_response
    for data in self.result:
  File "C:\Users\Jason Thaxter.KEPDOMAIN\Documents\_Software\python-retest\isapi-wsgi\examples\demo.py", line 26, in demo_app
    yield cr(' = '.join(item))
TypeError: sequence item 1: expected string, EXTENSION_CONTROL_BLOCK found
Traceback (most recent call last):
  File "C:\Python27\Lib\wsgiref\handlers.py", line 86, in run
    self.finish_response()
  File "C:\Python27\Lib\wsgiref\handlers.py", line 126, in finish_response
    for data in self.result:
  File "C:\Users\some-path\isapi-wsgi\examples\demo.py", line 26, in demo_app
    yield cr(' = '.join(item))
TypeError: sequence item 1: expected string, EXTENSION_CONTROL_BLOCK found
Traceback (most recent call last):
  File "C:\Python27\Lib\wsgiref\handlers.py", line 86, in run
    self.finish_response()
  File "C:\Python27\Lib\wsgiref\handlers.py", line 126, in finish_response
    for data in self.result:
  File "C:\Users\some-path\isapi-wsgi\examples\demo.py", line 26, in demo_app
    yield cr(' = '.join(item))
TypeError: sequence item 1: expected string, EXTENSION_CONTROL_BLOCK found

Jason R. Coombs

unread,
May 14, 2012, 8:03:03 PM5/14/12
to isapi_w...@googlegroups.com

In my experience with these types of issues, I’ll always back off until things start working again. I’ll uninstall URL Rewrite, and remove all references to any extensions in IIS to my Python Apps, and then start again, verifying the functionality at every step.

 

I haven’t used isapi_wsgi in depth for a while. I’ve been using it to mount a simple Python web site at the root, but not for anything else. I don’t even remember how I did it (though it’s all in my code repository for the site).

 

One thing I notice is that you’re running the demo from your home directory. I often find that I run into permission issues if I run any isapi_wsgi pages from anywhere except /inetpub, so I generally run my sites from there.

 

I’m unsure how URL Rewrite might interact with isapi_wsgi. It does seem to be interfering, though I couldn’t be sure how. I know it’s frustrating that isapi_rewrite is difficult to troubleshoot, but it’s the nature of the beast. Try to keep it as simple as possible and use win32traceutil to create trace statements (in isapi_wsgi or your code) to determine where things are going wrong.

 

Based on the error message you reported, it may be the case that URL Rewrite is actually modifying the code being passed to ISAPI_wsgi. If that’s the case, we may need to make some enhancements to it.

 

In any case, I hope that helps.

 

Regards,

Jason

 

--
You received this message because you are subscribed to the Google Groups "isapi_wsgi-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/isapi_wsgi-dev/-/iClKMuZmi-YJ.
To post to this group, send email to isapi_w...@googlegroups.com.
To unsubscribe from this group, send email to isapi_wsgi-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/isapi_wsgi-dev?hl=en.

Reply all
Reply to author
Forward
0 new messages