durusmail: quixote-users: fastCGI problems with Quixote-0.4.4
fastCGI problems with Quixote-0.4.4
2002-03-19
2002-03-20
2002-03-20
2002-03-20
fastCGI problems with Quixote-0.4.4 *** Caused by UBF!! ***
2002-03-20
fastCGI problems with Quixote-0.4.4
Neal M. Holtz
2002-03-20
On Wed, Mar 20, 2002 at 09:45:51AM -0500, Neil Schemenauer wrote:
> On Wed, Mar 20, 2002 at 05:00:09AM -0500, Neal M. Holtz wrote:
> > I've found something, but don't know what it means, yet:
> >
> > in fcgi.py there is this:
> >
> > def _startup():
> >     . . . lines omitted for brevity
> >     try:
> >         s=socket.fromfd(sys.stdin.fileno(), socket.AF_INET,
> >                         socket.SOCK_STREAM)
> >         s.getpeername()
> >     except socket.error, (err, errmsg):
> >         if err!=errno.ENOTCONN:       # must be a non-fastCGI environment
> >             _isFCGI = 0
> >             return
> >
> > The s.getpeername() call raises an exception, which causes
> > _isFCGI to be set to 0.  Why does this happen?
>
> Try changing socket.error to something like "foobar" (i.e. an exception
> that will never get raised).  Run it again and see what the traceback
> says.  Perhaps the socket is not connected but the errno is something
> other than ENOTCONN.

Actually, I just stuck a 'raise' right after the except socket.err, and
the partial traceback is:
  . . .
  File "/alt/python2.1/lib/python2.1/site-packages/quixote/fcgi.py", line 382,
in _startup
    s.getpeername()
socket.error: (88, 'Socket operation on non-socket')

>
> Also, since you know the script is running under FCGI you could comment
> out the s.getpeername() line and see if that works.

The script dies with an exception somewhere else when the socket
is used:

Traceback (most recent call last):
  File "/files/www/data/Quotes/New/test2/test.cgi", line 13, in ?
    app.publish_cgi()                       # Enter the publishing main loop
  File "publish.py", line 677, in publish_cgi
  File "/alt/python2.1/lib/python2.1/site-packages/quixote/fcgi.py", line 241,
in __init__
    self.conn, addr=_sock.accept()
socket.error: (88, 'Socket operation on non-socket')

--
Neal Holtz                             http://www.docuweb.ca/~nholtz
Dept. of Civil and Environmental Engineering,   Carleton University,
Ottawa, Ontario, Canada K1S 5B6.                   nholtz@docuweb.ca



reply