I have found the culprit!  It was in my code, but to my credit, I
copied it exactly from the documentation.

http://wiki.pylonshq.com/display/pysbook/Authentication+and+Authorization

== start quote ==
You can use a similar technique to restrict access to an individual
controller. Since all Pylons controllers are valid WSGI applications
you can also use the same authentication middleware to wrap the
controller.

Modifying the auth controller we created earlier, first import the
authorize middleware:

1 from authkit.authorize import middleware

Then right at the end of the file wrap your instantiated controller
class in the authorization middleware so that it looks like this:

1 AuthController = middleware(AuthController(), RemoteUser())
== end quote ==

There is a comment there that alludes that this may be a problem: "#
XXX Does this work? How can Pylons recreate the controller on each
request of # you do this????"

I can vouch that this doesn't work.  It messes things up in really
deceptive ways.  Please remove this section from the documentation!

Thank you,
David Snopek.

--
Open Source Hacker and Language Learner
http://www.hackyourlife.org/

On Nov 23, 3:23 pm, David Snopek <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> I am currently having a problem, where if two requests come into my
> server at almost the same time, I end up with a 500 server error.  I
> am using "paster serve" and "egg:Paste#http" on Pylons 0.9.6 and Paste
> 1.4.2.  The traceback I get ends with:
>
> Module paste.httpserver:166 in wsgi_start_response>>            assert 0, 
> "Attempt to set headers a second time w/o an exc_info"
>
>             self.wsgi_curr_headers = (status, response_headers)
>             return self.wsgi_write_chunk>>  assert 0, "Attempt to set
> headers a second time w/o an exc_info"
> exceptions.AssertionError: Attempt to set headers a second time w/o an
> exc_info
>
> I've done a ton of "print" statement debugging in Paste and Pylons,
> and what appears to be happening (although it seems impossible) is
> that the same code path is being run twice, with all the same
> variables and closures, etc.
>
> I found a thread on the PyDAP group that describes exactly the same
> problem I am having (they use Paste too).  This is the thread:
>
> http://groups.google.com/group/pydap/browse_thread/thread/d1a04b9e3db...
>
> I've already e-mailed Rob De Almeida asking him what the solution he
> found was.
>
> But I was wondering if any of you Pyloneers have encountered this
> before?
>
> As far as I can tell, I've been having this problem for a very, very
> long time, through a couple different versions of Pylons, but this is
> the first I've gotten around to debugging it.  There were always a few
> unexplainable 500 errors, but now I've got an AJAX page that will fail
> very reliably because of the timing of its requests.
>
> Any help would be appreciated!
>
> Thank you,
> David Snopek.
>
> --
> Open Source Hacker and Language Learnerhttp://www.hackyourlife.org/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to