durusmail: quixote-users: Non-reproducible problem: get_request() returns None
Non-reproducible problem: get_request() returns None
Non-reproducible problem: get_request() returns None
2005-01-24
Non-reproducible problem: get_request() returns None
2005-01-24
2005-01-24
Non-reproducible problem: get_request() returns None
Daniele Varrazzo
2005-01-24
Hi,

there is an error i found sometimes in Quixote applications. It is not
reproducible and following the same path after the error, everything may
work.

Sometimes, in a regular program run, get_request() returns None. Repeating
the same request issuing a page refresh usually works fine. It looks to me
it happens most often while rendering pages that are redirect() target,
but the last traceback i received from a testing environment looks like an
ordinary get.

The traceback ends with:
....
  File
"C:/Programmi/PiroSoftware/renapp\renapp\web\styles\renault\WebPage.ptl",
line 28, in render_header
    user = get_user()
  File "c:\programmi\python23\Lib\site-packages\quixote\publish.py", line
885, in get_user
    session = _publisher.get_request().session
AttributeError: 'NoneType' object has no attribute 'session'

The installation is
Windows 2000
Quixote 1.2
Apache/2.0.47
mod_python/3.1.3
Python/2.3.4

The error happens on all the computers i spent enough time on with Quixote
(they are at least 4, all with the same software configuration, apart
small differences: Quixote 1-1.2, Python 2.3.2-2.3.4, Apache/2.0.47-49).
It may happens once in a day, never in a week, but sometimes one each
other request. In the case of a burst of such errors, restarting Apache
helps. Refreshing the error page helps too: the following request appears
working (it may be dangerous refreshing the page after a POST, but usually
i issue a redirect() after POSTs, so only the redirected page is reloaded
and the form is not sent again.

Being get_request() a trivial function, i think about blaming mod_python
for messing up the namespace, but being the error occasional i can't
reproduce or better analyze it.

Did anybody notice the same problem? What piece of software may cause it?
I'm thinking about moving from mod_python to FCGI, but there isn't much
documentation about running FCGI in windows environment: what is the best
environment to make a web application live in (i mean no plain CGI: the
application holds resource pools that are not made to be bootsrapped at
each request).

Thank you in advance

Daniele




reply