Package: python-webpy
Version: 0.210-1
Severity: important

What a horrible subject for a bug report! Hopefully I can make it make
sense however.

Expected behaviour (lines beginning C: are sent from an http client to
Apache; lines beginning S: are the response):

 C: POST /
 C:
 C: (postdata)

 S: 302 found
 S: Location: /ok

 C: GET /ok

 S: 200 OK
 S:
 S: Your POST was processed

What actually happens:

 C: POST /
 C:
 C: (postdata)

 S: 200 OK
 S:
 S: Your POST was processed

Now, my setup: Webpy 0.21, Apache version 2.2.3 with mod_scgi version 1.11.

N.B., this only occurs with both Webpy 0.21 when accessed via SCGI. My
first instinct was to file a bug against libapache2-mod-scgi, except
that with Webpy 0.20 the bug goes away.

Apache's config looks like this:

 SCGIMount / localhost:40232

I'm attaching scgitest.py which (if you run 'scgitest.py scgi 40232')
will hopefully let you reproduce this bug.

Here is a dump of the conversation between mod_scgi and the web
application, which looks fine--you can see a request followed by a
response, then another request and response:

$ sudo ngrep -d lo port 40232 -x
interface: lo (127.0.0.0/255.0.0.0)
filter: (ip or ip6) and ( port 40232 )
####
T 127.0.0.1:44979 -> 127.0.0.1:40232 [AP]
  39 36 38 3a 43 4f 4e 54    45 4e 54 5f 4c 45 4e 47    968:CONTENT_LENG
  54 48 00 30 00 53 43 47    49 00 31 00 53 45 52 56    TH.0.SCGI.1.SERV
  45 52 5f 53 4f 46 54 57    41 52 45 00 41 70 61 63    ER_SOFTWARE.Apac
  68 65 2f 32 2e 32 00 53    45 52 56 45 52 5f 50 52    he/2.2.SERVER_PR
  4f 54 4f 43 4f 4c 00 48    54 54 50 2f 31 2e 31 00    OTOCOL.HTTP/1.1.
  53 45 52 56 45 52 5f 4e    41 4d 45 00 XXXXXXXXXXX    SERVER_NAME.XXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX 00 53 45 52 56 45 52    XXXXXXXXX.SERVER
  5f 41 44 4d 49 4e 00 5b    6e 6f 20 61 64 64 72 65    _ADMIN.[no addre
  73 73 20 67 69 76 65 6e    5d 00 53 45 52 56 45 52    ss given].SERVER
  5f 41 44 44 52 00 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    _ADDR.XXXXXXXXXX
  XXXXXXXXXXX 00 53 45 52    56 45 52 5f 50 4f 52 54    XXXX.SERVER_PORT
  00 38 30 00 52 45 4d 4f    54 45 5f 41 44 44 52 00    .80.REMOTE_ADDR.
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 00 52 45 4d    XXXXXXXXXXXX.REM
  4f 54 45 5f 50 4f 52 54    00 33 37 34 30 38 00 52    OTE_PORT.37408.R
  45 51 55 45 53 54 5f 4d    45 54 48 4f 44 00 50 4f    EQUEST_METHOD.PO
  53 54 00 52 45 51 55 45    53 54 5f 55 52 49 00 2f    ST.REQUEST_URI./
  00 51 55 45 52 59 5f 53    54 52 49 4e 47 00 00 53    .QUERY_STRING..S
  43 52 49 50 54 5f 4e 41    4d 45 00 00 50 41 54 48    CRIPT_NAME..PATH
  5f 49 4e 46 4f 00 2f 00    43 4f 4e 54 45 4e 54 5f    _INFO./.CONTENT_
  54 59 50 45 00 61 70 70    6c 69 63 61 74 69 6f 6e    TYPE.application
  2f 78 2d 77 77 77 2d 66    6f 72 6d 2d 75 72 6c 65    /x-www-form-urle
  6e 63 6f 64 65 64 00 44    4f 43 55 4d 45 4e 54 5f    ncoded.DOCUMENT_
  52 4f 4f 54 00 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    ROOT.XXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2f 70 75 62 6c    XXXXXXXXXXX/publ
  69 63 5f 68 74 6d 6c 00    48 54 54 50 5f 48 4f 53    ic_html.HTTP_HOS
  54 00 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    T.XXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 00    XXXXXXXXXXXXXXX.
  48 54 54 50 5f 55 53 45    52 5f 41 47 45 4e 54 00    HTTP_USER_AGENT.
  4d 6f 7a 69 6c 6c 61 2f    35 2e 30 20 28 58 31 31    Mozilla/5.0 (X11
  3b 20 3b 20 4c 69 6e 75    78 20 69 36 38 36 3b 20    ; ; Linux i686; 
  72 76 3a 31 2e 38 2e 31    2e 34 29 20 45 70 69 70    rv:1.8.1.4) Epip
  68 61 6e 79 2f 32 2e 31    38 00 48 54 54 50 5f 41    hany/2.18.HTTP_A
  43 43 45 50 54 00 74 65    78 74 2f 78 6d 6c 2c 61    CCEPT.text/xml,a
  70 70 6c 69 63 61 74 69    6f 6e 2f 78 6d 6c 2c 61    pplication/xml,a
  70 70 6c 69 63 61 74 69    6f 6e 2f 78 68 74 6d 6c    pplication/xhtml
  2b 78 6d 6c 2c 74 65 78    74 2f 68 74 6d 6c 3b 71    +xml,text/html;q
  3d 30 2e 39 2c 74 65 78    74 2f 70 6c 61 69 6e 3b    =0.9,text/plain;
  71 3d 30 2e 38 2c 69 6d    61 67 65 2f 70 6e 67 2c    q=0.8,image/png,
  2a 2f 2a 3b 71 3d 30 2e    35 00 48 54 54 50 5f 41    */*;q=0.5.HTTP_A
  43 43 45 50 54 5f 4c 41    4e 47 55 41 47 45 00 65    CCEPT_LANGUAGE.e
  6e 2d 67 62 2c 65 6e 3b    71 3d 30 2e 35 00 48 54    n-gb,en;q=0.5.HT
  54 50 5f 41 43 43 45 50    54 5f 45 4e 43 4f 44 49    TP_ACCEPT_ENCODI
  4e 47 00 67 7a 69 70 2c    64 65 66 6c 61 74 65 00    NG.gzip,deflate.
  48 54 54 50 5f 41 43 43    45 50 54 5f 43 48 41 52    HTTP_ACCEPT_CHAR
  53 45 54 00 49 53 4f 2d    38 38 35 39 2d 31 2c 75    SET.ISO-8859-1,u
  74 66 2d 38 3b 71 3d 30    2e 37 2c 2a 3b 71 3d 30    tf-8;q=0.7,*;q=0
  2e 37 00 48 54 54 50 5f    4b 45 45 50 5f 41 4c 49    .7.HTTP_KEEP_ALI
  56 45 00 33 30 30 00 48    54 54 50 5f 43 4f 4e 4e    VE.300.HTTP_CONN
  45 43 54 49 4f 4e 00 6b    65 65 70 2d 61 6c 69 76    ECTION.keep-aliv
  65 00 48 54 54 50 5f 52    45 46 45 52 45 52 00 XX    e.HTTP_REFERER.X
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXX 00 48 54 54    50 5f 43 41 43 48 45 5f    XXXX.HTTP_CACHE_
  43 4f 4e 54 52 4f 4c 00    6d 61 78 2d 61 67 65 3d    CONTROL.max-age=
  30 00 48 54 54 50 5f 43    4f 4e 54 45 4e 54 5f 54    0.HTTP_CONTENT_T
  59 50 45 00 61 70 70 6c    69 63 61 74 69 6f 6e 2f    YPE.application/
  78 2d 77 77 77 2d 66 6f    72 6d 2d 75 72 6c 65 6e    x-www-form-urlen
  63 6f 64 65 64 00 48 54    54 50 5f 43 4f 4e 54 45    coded.HTTP_CONTE
  4e 54 5f 4c 45 4e 47 54    48 00 30 00 2c             NT_LENGTH.0.,   
##
T 127.0.0.1:40232 -> 127.0.0.1:44979 [AP]
  53 74 61 74 75 73 3a 20    33 30 32 20 46 6f 75 6e    Status: 302 Foun
  64 0d 0a 43 6f 6e 74 65    6e 74 2d 54 79 70 65 3a    d..Content-Type:
  20 74 65 78 74 2f 68 74    6d 6c 0d 0a 4c 6f 63 61     text/html..Loca
  74 69 6f 6e 3a 20 2f 6f    6b 0d 0a 43 6f 6e 74 65    tion: /ok..Conte
  6e 74 2d 4c 65 6e 67 74    68 3a 20 30 0d 0a 0d 0a    nt-Length: 0....
######
T 127.0.0.1:44980 -> 127.0.0.1:40232 [AP]
  39 38 39 3a 43 4f 4e 54    45 4e 54 5f 4c 45 4e 47    989:CONTENT_LENG
  54 48 00 30 00 53 43 47    49 00 31 00 53 45 52 56    TH.0.SCGI.1.SERV
  45 52 5f 53 4f 46 54 57    41 52 45 00 41 70 61 63    ER_SOFTWARE.Apac
  68 65 2f 32 2e 32 00 53    45 52 56 45 52 5f 50 52    he/2.2.SERVER_PR
  4f 54 4f 43 4f 4c 00 48    54 54 50 2f 31 2e 31 00    OTOCOL.HTTP/1.1.
  53 45 52 56 45 52 5f 4e    41 4d 45 00 XXXXXXXXXXX    SERVER_NAME.XXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX 00 53 45 52 56 45 52    XXXXXXXXX.SERVER
  5f 41 44 4d 49 4e 00 5b    6e 6f 20 61 64 64 72 65    _ADMIN.[no addre
  73 73 20 67 69 76 65 6e    5d 00 53 45 52 56 45 52    ss given].SERVER
  5f 41 44 44 52 00 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    _ADDR.XXXXXXXXXX
  XXXXXXXXXXX 00 53 45 52    56 45 52 5f 50 4f 52 54    XXXX.SERVER_PORT
  00 38 30 00 52 45 4d 4f    54 45 5f 41 44 44 52 00    .80.REMOTE_ADDR.
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 00 52 45 4d    XXXXXXXXXXXX.REM
  4f 54 45 5f 50 4f 52 54    00 33 37 34 30 38 00 52    OTE_PORT.37408.R
  45 51 55 45 53 54 5f 4d    45 54 48 4f 44 00 47 45    EQUEST_METHOD.GE
  54 00 52 45 51 55 45 53    54 5f 55 52 49 00 2f 00    T.REQUEST_URI./.
  51 55 45 52 59 5f 53 54    52 49 4e 47 00 00 53 43    QUERY_STRING..SC
  52 49 50 54 5f 4e 41 4d    45 00 00 50 41 54 48 5f    RIPT_NAME..PATH_
  49 4e 46 4f 00 2f 6f 6b    00 43 4f 4e 54 45 4e 54    INFO./ok.CONTENT
  5f 54 59 50 45 00 61 70    70 6c 69 63 61 74 69 6f    _TYPE.applicatio
  6e 2f 78 2d 77 77 77 2d    66 6f 72 6d 2d 75 72 6c    n/x-www-form-url
  65 6e 63 6f 64 65 64 00    44 4f 43 55 4d 45 4e 54    encoded.DOCUMENT
  5f 52 4f 4f 54 00 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    _ROOT.XXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2e 75 6b 2f 70 75 62    XXXXXXXXXXXX/pub
  6c 69 63 5f 68 74 6d 6c    00 48 54 54 50 5f 48 4f    lic_html.HTTP_HO
  53 54 00 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    ST.XXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  00 48 54 54 50 5f 55 53    45 52 5f 41 47 45 4e 54    .HTTP_USER_AGENT
  00 4d 6f 7a 69 6c 6c 61    2f 35 2e 30 20 28 58 31    .Mozilla/5.0 (X1
  31 3b 20 3b 20 4c 69 6e    75 78 20 69 36 38 36 3b    1; ; Linux i686;
  20 72 76 3a 31 2e 38 2e    31 2e 34 29 20 45 70 69     rv:1.8.1.4) Epi
  70 68 61 6e 79 2f 32 2e    31 38 00 48 54 54 50 5f    phany/2.18.HTTP_
  41 43 43 45 50 54 00 74    65 78 74 2f 78 6d 6c 2c    ACCEPT.text/xml,
  61 70 70 6c 69 63 61 74    69 6f 6e 2f 78 6d 6c 2c    application/xml,
  61 70 70 6c 69 63 61 74    69 6f 6e 2f 78 68 74 6d    application/xhtm
  6c 2b 78 6d 6c 2c 74 65    78 74 2f 68 74 6d 6c 3b    l+xml,text/html;
  71 3d 30 2e 39 2c 74 65    78 74 2f 70 6c 61 69 6e    q=0.9,text/plain
  3b 71 3d 30 2e 38 2c 69    6d 61 67 65 2f 70 6e 67    ;q=0.8,image/png
  2c 2a 2f 2a 3b 71 3d 30    2e 35 00 48 54 54 50 5f    ,*/*;q=0.5.HTTP_
  41 43 43 45 50 54 5f 4c    41 4e 47 55 41 47 45 00    ACCEPT_LANGUAGE.
  65 6e 2d 67 62 2c 65 6e    3b 71 3d 30 2e 35 00 48    en-gb,en;q=0.5.H
  54 54 50 5f 41 43 43 45    50 54 5f 45 4e 43 4f 44    TTP_ACCEPT_ENCOD
  49 4e 47 00 67 7a 69 70    2c 64 65 66 6c 61 74 65    ING.gzip,deflate
  00 48 54 54 50 5f 41 43    43 45 50 54 5f 43 48 41    .HTTP_ACCEPT_CHA
  52 53 45 54 00 49 53 4f    2d 38 38 35 39 2d 31 2c    RSET.ISO-8859-1,
  75 74 66 2d 38 3b 71 3d    30 2e 37 2c 2a 3b 71 3d    utf-8;q=0.7,*;q=
  30 2e 37 00 48 54 54 50    5f 4b 45 45 50 5f 41 4c    0.7.HTTP_KEEP_AL
  49 56 45 00 33 30 30 00    48 54 54 50 5f 43 4f 4e    IVE.300.HTTP_CON
  4e 45 43 54 49 4f 4e 00    6b 65 65 70 2d 61 6c 69    NECTION.keep-ali
  76 65 00 48 54 54 50 5f    52 45 46 45 52 45 52 00    ve.HTTP_REFERER.
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXX 00 48 54    54 50 5f 43 41 43 48 45    XXXXX.HTTP_CACHE
  5f 43 4f 4e 54 52 4f 4c    00 6d 61 78 2d 61 67 65    _CONTROL.max-age
  3d 30 00 48 54 54 50 5f    43 4f 4e 54 45 4e 54 5f    =0.HTTP_CONTENT_
  54 59 50 45 00 61 70 70    6c 69 63 61 74 69 6f 6e    TYPE.application
  2f 78 2d 77 77 77 2d 66    6f 72 6d 2d 75 72 6c 65    /x-www-form-urle
  6e 63 6f 64 65 64 00 48    54 54 50 5f 43 4f 4e 54    ncoded.HTTP_CONT
  45 4e 54 5f 4c 45 4e 47    54 48 00 30 00 52 45 44    ENT_LENGTH.0.RED
  49 52 45 43 54 5f 53 54    41 54 55 53 00 32 30 30    IRECT_STATUS.200
  00 2c                                                 .,              
##
T 127.0.0.1:40232 -> 127.0.0.1:44980 [AP]
  53 74 61 74 75 73 3a 20    32 30 30 20 4f 4b 0d 0a    Status: 200 OK..
  43 6f 6e 74 65 6e 74 2d    4c 65 6e 67 74 68 3a 20    Content-Length: 
  38 36 0d 0a 0d 0a 44 6f    6e 65 2e 20 49 66 20 79    86....Done. If y
  6f 75 20 61 72 65 20 73    74 69 6c 6c 20 61 74 20    ou are still at 
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXX
  XXXXXXXXXXX 2f 20 74 68    65 6e 20 79 6f 75 20 68    XXXX/ then you h
  69 74 20 74 68 65 20 62    75 67 2e 0a                it the bug..    
######exit
40 received, 0 dropped

And here's the conversation between Apache and the http client. Note
that the 302 and redirection to /ok is swallowed up somewhere:

$ sudo ngrep -d any port 80 -W byline
interface: any
filter: (ip or ip6) and ( port 80 )
######
T 192.168.0.50:37409 -> XXXXXXXXXXXXXX:80 [AP]
POST / HTTP/1.1.
Host: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
User-Agent: Mozilla/5.0 (X11; ; Linux i686; rv:1.8.1.4) Epiphany/2.18.
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5.
Accept-Language: en-gb,en;q=0.5.
Accept-Encoding: gzip,deflate.
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7.
Keep-Alive: 300.
Connection: keep-alive.
Referer: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
Cache-Control: max-age=0.

##
T 192.168.0.50:37409 -> XXXXXXXXXXXXXX:80 [AP]
Content-Type: application/x-www-form-urlencoded.
Content-Length: 0.
.

##
T XXXXXXXXXXXXXX:80 -> 192.168.0.50:37409 [AP]
HTTP/1.1 200 OK.
Date: Sat, 16 Jun 2007 17:21:37 GMT.
Server: Apache/2.2.
Vary: Accept-Encoding.
Content-Encoding: gzip.
Content-Length: 95.
Keep-Alive: timeout=15, max=100.
Connection: Keep-Alive.
Content-Type: text/html; charset=UTF-8.
.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
#exit
11 received, 0 dropped

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (540, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages python-webpy depends on:
ii  python                        2.4.4-2    An interactive high-level object-o
ii  python-support                0.5.6      automated rebuilding support for p

Versions of packages python-webpy recommends:
pn  python-cheetah                <none>     (no description available)
ii  python-flup                   0.2126-1   Implements Python Web Server Gatew
pn  python-mysqldb                <none>     (no description available)

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to