You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yuesong Wang <yu...@gmail.com> on 2011/01/19 20:54:53 UTC

Request Line Truncated and Caused 501

Hi,

I have tomcat 6.0.29 configured using the NIO connector running on linux. My access log shows strange 501 errors like this:

86.24.156.114 - - [19/Jan/2011:14:41:28 -0500] "eferer: /static/r07/sh30.html " 501 1235 "-" "-"
41.203.64.251 - - [19/Jan/2011:14:39:18 -0500] "ET <actual url> HTTP/1.1" 501 1220 "<actual referrer>" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; CPNTDF; .NET4.0C)"

It seems something went wrong while reading the request, and a rather random chunk is treated as the request uri. I thought it had to do with the maxHttpHeaderSize being too small, and tried to reproduce it but couldn't. I suspect the http request itself is malformed, but can't be sure because I can't get to the raw request (RequestDumperValve happens after the raw request is parsed I think).

Any idea what the problem may be or how to go about investigating this?

Thanks,

Yuesong
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Request Line Truncated and Caused 501

Posted by Yuesong Wang <yu...@gmail.com>.
Thanks. I think Mark identified the memory problem in 6.0.30. So we will try again when a new release is available with the fix. For now we've reverted to 6.0.20 which seems to be free of both defects.

Yuesong

On Jan 20, 2011, at 11:38 AM, Jason Pyeron wrote:

>> -----Original Message-----
>> From: Yuesong Wang 
>> Sent: Thursday, January 20, 2011 10:41
>> To: Tomcat Users List
>> Subject: Re: Request Line Truncated and Caused 501
>> 
>> Thanks. I tried 6.0.30, but under heavy load in our 
>> production environment, its memory usage shot up in a matter 
>> of minutes and we had to bring it down. We did not see that in 6.0.29.
> 
> The patch should easily back port.
> 
>> On Jan 19, 2011, at 5:59 PM, Mark Thomas wrote:
>> 
> <snip/>
>>> 
>>> Known issue. Fixed in 6.0.30.
>>> http://issues.apache.org/bugzilla/show_bug.cgi?id=50072
>>> 
> 
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> -                                                               -
> - Jason Pyeron                      PD Inc. http://www.pdinc.us -
> - Principal Consultant              10 West 24th Street #100    -
> - +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
> -                                                               -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Request Line Truncated and Caused 501

Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Yuesong Wang 
> Sent: Thursday, January 20, 2011 10:41
> To: Tomcat Users List
> Subject: Re: Request Line Truncated and Caused 501
> 
> Thanks. I tried 6.0.30, but under heavy load in our 
> production environment, its memory usage shot up in a matter 
> of minutes and we had to bring it down. We did not see that in 6.0.29.

The patch should easily back port.

> On Jan 19, 2011, at 5:59 PM, Mark Thomas wrote:
> 
<snip/>
> > 
> > Known issue. Fixed in 6.0.30.
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=50072
> > 

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Request Line Truncated and Caused 501

Posted by Yuesong Wang <yu...@gmail.com>.
Thanks. I tried 6.0.30, but under heavy load in our production environment, its memory usage shot up in a matter of minutes and we had to bring it down. We did not see that in 6.0.29.

Yuesong

On Jan 19, 2011, at 5:59 PM, Mark Thomas wrote:

> On 19/01/2011 19:54, Yuesong Wang wrote:
>> Hi,
>> 
>> I have tomcat 6.0.29 configured using the NIO connector running on linux. My access log shows strange 501 errors like this:
> 
> Known issue. Fixed in 6.0.30.
> http://issues.apache.org/bugzilla/show_bug.cgi?id=50072
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Request Line Truncated and Caused 501

Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org] 
> Sent: Wednesday, January 19, 2011 17:59
> To: Tomcat Users List
> Subject: Re: Request Line Truncated and Caused 501
> 
> On 19/01/2011 19:54, Yuesong Wang wrote:
> > Hi,
> > 
> > I have tomcat 6.0.29 configured using the NIO connector 
> running on linux. My access log shows strange 501 errors like this:
> 
> Known issue. Fixed in 6.0.30.
> http://issues.apache.org/bugzilla/show_bug.cgi?id=50072

Very nice, good memory on the bug, just read the patch.

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Request Line Truncated and Caused 501

Posted by Mark Thomas <ma...@apache.org>.
On 19/01/2011 19:54, Yuesong Wang wrote:
> Hi,
> 
> I have tomcat 6.0.29 configured using the NIO connector running on linux. My access log shows strange 501 errors like this:

Known issue. Fixed in 6.0.30.
http://issues.apache.org/bugzilla/show_bug.cgi?id=50072

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Request Line Truncated and Caused 501

Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Christopher Schultz 
> Sent: Wednesday, January 19, 2011 17:50
> To: Tomcat Users List
> Subject: Re: Request Line Truncated and Caused 501
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jason,
> 
> On 1/19/2011 3:05 PM, Jason Pyeron wrote:
> >> -----Original Message-----
> >> From: Yuesong Wang > Sent: Wednesday, January 19, 2011 14:55
> >> To: users@tomcat.apache.org
> >> Subject: Request Line Truncated and Caused 501
> >>
> >> Hi,
> >>
> >> I have tomcat 6.0.29 configured using the NIO connector running on 
> >> linux. My access log shows strange 501 errors like this:
> >>
> > 
> > Does the NIO think it is on windows?
> 
> Why would that matter?

Seen problems like this in perl, oracle, and may other things written for
windows run on non-windows.

> 
> >> 86.24.156.114 - - [19/Jan/2011:14:41:28 -0500] "eferer: 
> >> /static/r07/sh30.html " 501 1235 "-" "-"
> >> 41.203.64.251 - - [19/Jan/2011:14:39:18 -0500] "ET <actual
> >> url> HTTP/1.1" 501 1220 "<actual referrer>" "Mozilla/4.0
> >> (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; 
> >> SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; 
> >> Media Center PC 6.0; CPNTDF; .NET4.0C)"
> >>
> > 
> > If chomping off the 0x0A when there is none, you could get this.
> 
> HTTP protocol says lines end with CR LF.
> 

Then is the client not sending it and the tomcat code skipping... (I did see the
no leading CRLF below)

> Perhaps the client is broken? It says MSIE, so it probably is. :)
> 
> The first line of the request shouldn't contain a leading CR 
> or LF and should start with an HTTP verb (like GET). It looks 
> like "GET" is being truncated to "ET" at some point.

Good point.

> 
> >> I
> >> thought it had to do with the maxHttpHeaderSize being too 
> small, and 
> >> tried to reproduce it but couldn't. I suspect the http 
> request itself 
> >> is malformed, but can't be sure because I can't get to the raw 
> >> request (RequestDumperValve happens after the raw request 
> is parsed I 
> >> think).
> >>
> >> Any idea what the problem may be or how to go about investigating 
> >> this?
> 
> Can you search your access log for requests that don't start 
> with valid HTTP verbs? That might help you narrow down what 
> conditions cause the requests to get mangled. Maybe there 
> really is some broken client out there.
> 
> What % of requests does this represent? What opportunities do 
> you have to reconfigure the server and continue to collect data?
> 

And can this be reproduced?


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Request Line Truncated and Caused 501

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason,

On 1/19/2011 3:05 PM, Jason Pyeron wrote:
>> -----Original Message-----
>> From: Yuesong Wang > Sent: Wednesday, January 19, 2011 14:55
>> To: users@tomcat.apache.org
>> Subject: Request Line Truncated and Caused 501
>>
>> Hi,
>>
>> I have tomcat 6.0.29 configured using the NIO connector 
>> running on linux. My access log shows strange 501 errors like this:
>>
> 
> Does the NIO think it is on windows?

Why would that matter?

>> 86.24.156.114 - - [19/Jan/2011:14:41:28 -0500] "eferer: 
>> /static/r07/sh30.html " 501 1235 "-" "-"
>> 41.203.64.251 - - [19/Jan/2011:14:39:18 -0500] "ET <actual 
>> url> HTTP/1.1" 501 1220 "<actual referrer>" "Mozilla/4.0 
>> (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; 
>> GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET 
>> CLR 3.0.30729; Media Center PC 6.0; CPNTDF; .NET4.0C)"
>>
> 
> If chomping off the 0x0A when there is none, you could get this.

HTTP protocol says lines end with CR LF.

Perhaps the client is broken? It says MSIE, so it probably is. :)

The first line of the request shouldn't contain a leading CR or LF and
should start with an HTTP verb (like GET). It looks like "GET" is being
truncated to "ET" at some point.

>> I 
>> thought it had to do with the maxHttpHeaderSize being too 
>> small, and tried to reproduce it but couldn't. I suspect the 
>> http request itself is malformed, but can't be sure because I 
>> can't get to the raw request (RequestDumperValve happens 
>> after the raw request is parsed I think).
>>
>> Any idea what the problem may be or how to go about 
>> investigating this?

Can you search your access log for requests that don't start with valid
HTTP verbs? That might help you narrow down what conditions cause the
requests to get mangled. Maybe there really is some broken client out there.

What % of requests does this represent? What opportunities do you have
to reconfigure the server and continue to collect data?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk03arUACgkQ9CaO5/Lv0PA56QCePMcmTox8zkujlks+Mz0O8ngN
sF8AoK7ci3AWd5d3me2ALI/nfpwRteyS
=iUNt
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Request Line Truncated and Caused 501

Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Yuesong Wang > Sent: Wednesday, January 19, 2011 14:55
> To: users@tomcat.apache.org
> Subject: Request Line Truncated and Caused 501
> 
> Hi,
> 
> I have tomcat 6.0.29 configured using the NIO connector 
> running on linux. My access log shows strange 501 errors like this:
> 

Does the NIO think it is on windows?

> 86.24.156.114 - - [19/Jan/2011:14:41:28 -0500] "eferer: 
> /static/r07/sh30.html " 501 1235 "-" "-"
> 41.203.64.251 - - [19/Jan/2011:14:39:18 -0500] "ET <actual 
> url> HTTP/1.1" 501 1220 "<actual referrer>" "Mozilla/4.0 
> (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; 
> GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET 
> CLR 3.0.30729; Media Center PC 6.0; CPNTDF; .NET4.0C)"
> 

If chomping off the 0x0A when there is none, you could get this.

> It seems something went wrong while reading the request, and 
> a rather random chunk is treated as the request uri. I 
> thought it had to do with the maxHttpHeaderSize being too 
> small, and tried to reproduce it but couldn't. I suspect the 
> http request itself is malformed, but can't be sure because I 
> can't get to the raw request (RequestDumperValve happens 
> after the raw request is parsed I think).
> 
> Any idea what the problem may be or how to go about 
> investigating this?

Try using a low level tool like curl to reproduce problems.





--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org