[IronPython] IronPython/NWSGI 0-byte 200/404 response with HelloWorld?

Markus Törnqvist mjt at nysv.org
Mon Sep 28 10:40:29 CEST 2009


On Sun, Sep 27, 2009 at 11:34:38AM -0600, Jeff Hardy wrote:
>On Sat, Sep 26, 2009 at 2:34 PM, Markus Törnqvist <mjt at nysv.org> wrote:

>>  Could not load type 'Microsoft.Scripting.Runtime.CodeContext' from assembly
>>  'Microsoft.Scripting, Version=1.0.0.0, Culture=neutral,
>>  PublicKeyToken=31bf3856ad364e35'.
>> ...
>This is proably due to the assemblyBindings. I'll try to get a new
>build of NWSGI out ASAP. but I'm strapped for time. Sorry.

Myeah, thanks. I'm just bummed because it seemed to work so well at first.

>> Is the XML extremely sensitive to newlines and stuff?

>> The ONLY pattern I've been able to discern is that:
>> 1. requests sometimes take a LONG time, especially the first time around
>
>This is to be expected. IronPython's straup times are less than stellar.

I don't know what IIS does when I stop and start a site, but apparently
nothing enough. iisreset however seems to really reset it, and that's
when the first load takes a long time. The long first load can then be
interrupted to get other interesting server errors.

>> 2. if I reload in mid-request, I might get different effects
>This is odd.

 'module' object has no attribute 'wsgi' 

 Line 14: import django.core.handlers.wsgi
 Line 15: 
 Line 16: application = django.core.handlers.wsgi.WSGIHandler()

Extremely annoying.

If if I add an explicit "import wsgi" in handlers\__init__.py, I get
 'module' object has no attribute 'handlers' 

I thought, I hoped, these import errors would go away, but no.

Is there ANY chance that it's because I'm also hitting the
"Could not load type" bug? Something just doesn't get initialized properly
and then doesn't work?

I'm hitting it often enough and there's a strong pattern that those
imports fail if I interrupt the first page load.

Also I got the traceback http://ironpython.pastebin.com/m40f40896

The second refresh (and subsequent refreshes) give a shorter trace
http://ironpython.pastebin.com/m1f3bfd6d

[session.engine]
>Try setting it to 'django.contrib.sessions.backends.cache' and setting
>CACHE_BACKEND = 'locmem:///'. I've used that combo in the past and it
>has worked for me.

Nada, sorry, 'module' object has no attribute 'handlers' and all that.

>> Hope any of this helps..?
>Ttry going back to NWSGI 2.0 B2 and IronPython 2.6 B2 and see if that
>works any better.

As for NWSGI that's what I've been using all the time, Aug 15 2009 release :/

So I uninstalled rc1 and installed b2, copied the seven dlls, commented
out the runtime block from xml and said iisreset.

Now I can get the bona-fide Django exception:
AttributeError at /

'module' object has no attribute 'url_patterns'

Request Method:   GET
Request URL:  http://localhost//
Exception Type:   AttributeError
Exception Value:  

'module' object has no attribute 'url_patterns'

Exception Location:   C:\Program Files\IronPython 2.6\Lib\site-packages\django\core\urlresolvers.py in resolve, line 182
Python Executable:  None
Python Version:   2.6.0
Python Path:  ['C:\\Program Files\\IronPython 2.6\\Lib\\site-packages\\mysite\\', 'C:\\Program Files\\IronPython 2.6\\Lib\\site-packages\\mysite\\bin\\Lib', 'C:\\Program Files\\IronPython 2.6\\Lib', 'C:\\Program Files\\IronPython 2.6\\Lib\\site-packages', 'C:\\Program Files\\IronPython 2.6\\Lib\\site-packages\\django', 'C:\\Program Files\\IronPython 2.6\\Lib\\site-packages\\mysite']
Server time:  Mon, 28 Sep 2009 11:29:35 +0300

I don't know if this could be called a regression, but it kinda seems like one,
because I'm not getting any of the DLL-space IIS errors with 2.6B2.

In fact, even if I do iisreset and let the first request take the
less-than-stellar time, it just gives me the Django traceback.

>Bit by bit, things should come together. I have had large parts of
>django working, so I know it's possible. I really wish I had more time
>to look at this, but all I can do right now is offer advice :).

It'd be sweet of someone with a stronger knowledge in matters Windows+IIS
to look at it too, I'm feeling blind here.

There was another thread at
http://lists.ironpython.com/pipermail/users-ironpython.com/2009-September/011274.html

Should this be taken as a sign that NWSGI is non-trivial to get running
with 2.6RC1 and a lot of the DLL-space errors could stem from forcibly
forcing stuff to work that just can't work together?

Thanks!

-- 
mjt




More information about the Ironpython-users mailing list