patricmutwiri / mod-spdy

Automatically exported from code.google.com/p/mod-spdy
0 stars 0 forks source link

Invalid method in request 0 #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When i POST a form via https which has at least 1 datafield via Chrome 
18.0.997.0 i get the following error in the apache error_log:

[Mon Jan 30 21:53:17 2012] [error] [client 2001:4dd0:ff00:1ef::2] Invalid 
method in request 0

The POST Data isn´t transmitted to php, (postdata is empty)..

I use mod_fcgid to drive php (because mod_php isn´t threadsafe)

i use the r231 version of mod_spdy and used the script on this google project 
page to compile mod_ssl

The problem disappears when i disable mod_spdy

https://admin.neosolve.de/posttest.php <- this is a script on the server which 
just echos $_POST (php)

My apache version is Apache/2.2.16 (Debian)

Original issue reported on code.google.com by timo.witte on 30 Jan 2012 at 10:02

GoogleCodeExporter commented 8 years ago
i can supply root-access to the box if you need it write me an email 
timo.witte@googlemail.com

Original comment by timo.witte on 30 Jan 2012 at 10:06

GoogleCodeExporter commented 8 years ago
Thanks for the report.  I can see the problem at that URL with Chrome (using 
SPDY), and I can also see that the form does work correctly when connecting 
over SSL with a non-SPDY browser.

Unfortunately, I haven't been able to reproduce the problem locally yet -- when 
I test POSTing to a simple CGI script with mod_spdy, it works fine.  I will try 
testing it with mod_php specifically.

If you have a chance, can you try testing with a simple e.g. Python/Perl CGI 
script, such as the one attached here?  Do POST requests seem to work for you 
with mod_spdy in that case, or do they have the same problem?  Also, could you 
let me know what other Apache modules you have installed (apache2ctl -M)?

Original comment by mdste...@google.com on 31 Jan 2012 at 6:25

Attachments:

GoogleCodeExporter commented 8 years ago
https://admin.neosolve.de/simple.py <- Seems to work with the python script
i use php via mod_fcgid, because of thread safety.

Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_worker_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 cgid_module (shared)
 dav_module (shared)
 dav_svn_module (shared)
 authz_svn_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 fcgid_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 pagespeed_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 spdy_module (shared)
 ssl_module (shared)
 status_module (shared)

Original comment by timo.witte on 31 Jan 2012 at 7:03

GoogleCodeExporter commented 8 years ago
i tried to disable the pagespeed_module, because i thought it may interfere, 
but it didn´t help.

Original comment by timo.witte on 31 Jan 2012 at 7:05

GoogleCodeExporter commented 8 years ago
Thanks very much for your help with debugging this.  I seem to have reproduced 
the issue on my own machine, with mod_fcgid and a similar PHP script that 
simply echos back $_POST.  (I get a somewhat different error message in my log, 
but the effect is the same (PHP can't see the post data), and I think the 
underlying cause is probably the same.)

While investigating, I found a simple bug in the way that mod_spdy decodes POST 
requests from SPDY to HTTP that was part of the problem -- I will be committing 
a patch pretty soon that fixes that issue.  With that fix, my error message 
goes away; however, PHP still can't see the post data.

I will continue to investigate the issue, but I think I know what's wrong.  
Because SPDY payload data is streamed in frame by frame, it is natural to 
translate this into HTTP chunked encoding, so that's what mod_spdy does.  With 
a CGI script, this seems to work fine (which I can confirm by turning off 
SSL/SPDY and using telnet to send a chunked HTTP POST request to the CGI 
script).  With fcgid/PHP, however, the chunked payload seems to be ignored 
(again, sending the raw request with telnet without SSL/SPDY is an easy way to 
check); perhaps they simply don't accept chunked requests?  I still need to 
figure out exactly why this, and decide how to work around it.

Original comment by mdste...@google.com on 1 Feb 2012 at 7:48

GoogleCodeExporter commented 8 years ago
Okay, that partial fix I mentioned above has been checked in as r234.  The main 
issue most likely still remains, however; I'll keep working on it.  Thanks for 
your patience.

Original comment by mdste...@google.com on 1 Feb 2012 at 8:15

GoogleCodeExporter commented 8 years ago
Thanks a lot for looking into this!
i found a bug on php.net ( https://bugs.php.net/bug.php?id=60826 ) which 
describes exactly that problem (chunked POST data), with the exact same 
outcome.. Seems to be a new php problem i think.
I have to write some exams here tomorrow :( so i can´t look into the php 
source, because i don´t have the time.. But this is the last exam, so i have 
time afterwards :)

Original comment by timo.witte on 2 Feb 2012 at 12:33

GoogleCodeExporter commented 8 years ago
I've committed a patch as r236 that I think will solve this problem.  With my 
test setup synced to this revision, my test PHP script now correctly receives 
POST data.  Can you try updating and seeing if things now work for you as well?

Original comment by mdste...@google.com on 3 Feb 2012 at 8:47

GoogleCodeExporter commented 8 years ago
Ok i have updated,

it works perfectly! Thank you for fixing it. I think i wasn´t the only one 
having this problem.

Thanks a lot! Would love to see mod_spdy used more widespred.. But i think its 
a problem that most webmasters dont know how to setup it or dont know how to 
get a trusted SSL certificate.

Original comment by timo.witte on 5 Feb 2012 at 10:45

GoogleCodeExporter commented 8 years ago
Wonderful, glad to hear it!  I'm going to mark this fixed, then.  Thanks again 
for all your feedback -- it was very helpful in tracking down the problem.

Original comment by mdste...@google.com on 6 Feb 2012 at 3:30