You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ravi Kiran <ra...@gmail.com> on 2015/06/04 17:40:02 UTC

Tomcat losing request parameters

Hi,

I am writing to get some pointers on a strange issue which are facing in
tomcat in one of our client environments.

Setup: 4 Webservers connecting to 2 tomcat using mod_jk (load balanced)

Issue: Request parameters GET/POST are coming as null to the application
intermittently i.e, filter in web app dumps the request parameters and
finds everything empty. TCP dumps are inspected and packets are reaching
tomcat even during the failure cases. Parameters are available in tcpdump
but lost in between before it reaches application. This happens only on one
specific client environment which makes it even difficult to isolate the
problem.

Tomcat Version: 7.0.54

Please suggest some pointers to debug and resolve this issue. I can provide
more info if needed.

Regards,
Ravi

Re: Tomcat losing request parameters

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

Ravi,

On 6/4/15 10:44 PM, Ravi Kiran wrote:
> All the parameters are lost when this issue occurs.
> 
> Code in the filter:
> 
> Map<String, String[]> paramMap = httpRequest.getParameterMap(); 
> StringBuilder sb = new StringBuilder(); if(paramMap != null) { 
> sb.append(System.lineSeparator()); sb.append("Request URI:
> ").append(httpRequest.getRequestURI()); Enumeration<String>
> headerNames = httpRequest.getHeaderNames(); 
> while(headerNames.hasMoreElements()){ String header =
> headerNames.nextElement(); sb.append("Request Header Name:
> ").append(header); sb.append(", Request Header Value:
> ").append(httpRequest.getHeader(header)); 
> sb.append(System.lineSeparator()); } 
> sb.append(System.lineSeparator()); for(Map.Entry<String, String[]>
> paramEntry : paramMap.entrySet()) { sb.append("Param Name:
> ").append(paramEntry.getKey()); sb.append(", Param Values:
> ").append(paramEntry.getValue() != null ? 
> Arrays.asList(paramEntry.getValue()) : null); 
> sb.append(System.lineSeparator()); } } LOG.debug("Dumping request
> parameters: {}", sb.toString());

That looks fairly straightforward to me.

Is the servlet expecting to consume the request entity directly (e.g.
a multi-part request, etc.)?

Also, you didn't say whether all of the parameters have been "lost" or
only some.

To markt's point: are you storing any request-related objects
anywhere, such as a filter's or servlet's members, or in the user's
HttpSession, or even in the request attributes, etc.?

- -chris

> On Thu, Jun 4, 2015 at 9:54 AM, Christopher Schultz < 
> chris@christopherschultz.net> wrote:
> 
> Ravi,
> 
> On 6/4/15 11:40 AM, Ravi Kiran wrote:
>>>> Hi,
>>>> 
>>>> I am writing to get some pointers on a strange issue which
>>>> are facing in tomcat in one of our client environments.
>>>> 
>>>> Setup: 4 Webservers connecting to 2 tomcat using mod_jk
>>>> (load balanced)
>>>> 
>>>> Issue: Request parameters GET/POST are coming as null to the 
>>>> application intermittently i.e, filter in web app dumps the
>>>> request parameters and finds everything empty. TCP dumps are
>>>> inspected and packets are reaching tomcat even during the
>>>> failure cases. Parameters are available in tcpdump but lost
>>>> in between before it reaches application. This happens only
>>>> on one specific client environment which makes it even
>>>> difficult to isolate the problem.
>>>> 
>>>> Tomcat Version: 7.0.54
>>>> 
>>>> Please suggest some pointers to debug and resolve this issue.
>>>> I can provide more info if needed.
> 
> Can we see the code for your Filter?
> 
> Do all of the parameters appear to disappear, or only some of
> them?
> 
> -chris
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVdcqXAAoJEBzwKT+lPKRYlBYQAJpZsYAwNFXCM31kZMEUrHr/
yR4QOLJGuEv4FPgteR0YCEJMjmCBQ3Yj8Uq2U0AsYlDAivFuuBcIDWP8DnFWb0xi
TfrcanIwNKfzjblVEuh+HB8/Cf5IjAkBsWNLSa5ntxODooiqkOOikCNPP4l3IPNs
dBGS+XKrlhjDkVUwI2+KmcEkSLHoU0hcGLNYd/K+K1pxGUxYDPUwB2KgV+6iVgQP
X0GaB8BUTChp4GFZAQEkIXz1hz1QYAR2syqTIcYmB/SjrtsSAf5dIKqZhnsaXRKA
Ywl6CVAjvEizvExHOmv6jHIV0EOEqzmWZfWUGTE3qtbpxxSi1O3zXlC6S6p8Odwp
PrTo6KvZG39HWH7R1AZKxfdeDD5IYfXtU21TX2RzLcuUQRI3xLhrrrAGYrb7KPuj
0fLZB4uHQ9f3rQP2Lofl+KN+sja3xLbTbaBpU7+urXfnnXoV1Yfnic4ju3k+xxzN
mgJQOBLFWSR4ZwjkuzDMsuWpokBb0DcA7odJcZCDQibfM3zyR9fZMUCtjayL5UzZ
/d3JiYVe9ZCtq0VlsbqxDo6r9OHuntgSIOE7GQ5ebz8F/E+uP6lZR2Fvw3z5Hg1C
oqPcil3eMNIgV3m+9k7DZP5FFyYHae06Yk1IV6ISwJ+20bmvs37FzCAwW85DJffG
Z7Qf6IjgNfP1SvQRl0KU
=IS6i
-----END PGP SIGNATURE-----

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


Re: Tomcat losing request parameters

Posted by Ravi Kiran <ra...@gmail.com>.
Christopher,

All the parameters are lost when this issue occurs.

Code in the filter:

Map<String, String[]> paramMap = httpRequest.getParameterMap();
StringBuilder sb = new StringBuilder();
if(paramMap != null) {
sb.append(System.lineSeparator());
sb.append("Request URI: ").append(httpRequest.getRequestURI());
Enumeration<String> headerNames = httpRequest.getHeaderNames();
while(headerNames.hasMoreElements()){
String header = headerNames.nextElement();
sb.append("Request Header Name: ").append(header);
sb.append(", Request Header Value: ").append(httpRequest.getHeader(header));
sb.append(System.lineSeparator());
}
sb.append(System.lineSeparator());
for(Map.Entry<String, String[]> paramEntry : paramMap.entrySet()) {
sb.append("Param Name: ").append(paramEntry.getKey());
sb.append(", Param Values: ").append(paramEntry.getValue() != null ?
Arrays.asList(paramEntry.getValue()) : null);
sb.append(System.lineSeparator());
}
}
 LOG.debug("Dumping request parameters: {}", sb.toString());

Regards,
Ravi

On Thu, Jun 4, 2015 at 9:54 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Ravi,
>
> On 6/4/15 11:40 AM, Ravi Kiran wrote:
> > Hi,
> >
> > I am writing to get some pointers on a strange issue which are
> > facing in tomcat in one of our client environments.
> >
> > Setup: 4 Webservers connecting to 2 tomcat using mod_jk (load
> > balanced)
> >
> > Issue: Request parameters GET/POST are coming as null to the
> > application intermittently i.e, filter in web app dumps the request
> > parameters and finds everything empty. TCP dumps are inspected and
> > packets are reaching tomcat even during the failure cases.
> > Parameters are available in tcpdump but lost in between before it
> > reaches application. This happens only on one specific client
> > environment which makes it even difficult to isolate the problem.
> >
> > Tomcat Version: 7.0.54
> >
> > Please suggest some pointers to debug and resolve this issue. I can
> > provide more info if needed.
>
> Can we see the code for your Filter?
>
> Do all of the parameters appear to disappear, or only some of them?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJVcIKvAAoJEBzwKT+lPKRY6ioQALCHKEO/7Yj9RCkKXSPoBAOW
> ayw8a0Pj802SwxTR1lBhvPf71ZiGqwmGv46a2ZxFDI+N6C0KB+6afI17XeoyjRKV
> ieuBypeBpsYijVkwCHFICiwlF8U6fe2ar9KG+Vhffffjz/8DNweVXHtwRHDIK3G+
> EQ22qGuyH5ydcw+e3M63hHGwHsLf3YK3akJR5soOAboHTbYADU374vqRmSWlRb70
> Lcxq+691cvAbJH6yKen5oo9O+F2aMhMti/rvXrhSRQT2cfWQNKjLWIg7d3CPORsp
> 6FGpQieCJ/csO/2pBz4RKXopfGcybc5EGjh9uNgqQwmMtBoPHgTy1JWcumX80K3s
> tYKYPcexR0qPpIEB76owAvbYUIgdlswhljYT8Wz7Fr7KZbxhFzoAhGSxitJHPgTC
> kUmCrFW9ote9Xxn8tRHnVMvT45YVcA6i8vVLczKH/wzyAR/PVpgqI5Xrn+gMHDXH
> Ld4XZYpc1xtT5bo1/QdRNoL9rl3TpJvbqCkfPfqNPCEv3vddzjmnmalJnvLbD/7C
> Fvy639CaFqxl/0KNBcVsJdMg3JLnoaExa2UY5lpZA6L6rsqkYaQEBmfT97PKwaVp
> Z7ftmW9bwTJ6BZArR3z4qEihWwm7AxNIk6sRO+Ef3tH0dIfqixClR+ccNZqNqvBP
> fxboiBuGytLH5beNzUqi
> =z+IM
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat losing request parameters

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

Ravi,

On 6/4/15 11:40 AM, Ravi Kiran wrote:
> Hi,
> 
> I am writing to get some pointers on a strange issue which are
> facing in tomcat in one of our client environments.
> 
> Setup: 4 Webservers connecting to 2 tomcat using mod_jk (load
> balanced)
> 
> Issue: Request parameters GET/POST are coming as null to the
> application intermittently i.e, filter in web app dumps the request
> parameters and finds everything empty. TCP dumps are inspected and
> packets are reaching tomcat even during the failure cases.
> Parameters are available in tcpdump but lost in between before it
> reaches application. This happens only on one specific client
> environment which makes it even difficult to isolate the problem.
> 
> Tomcat Version: 7.0.54
> 
> Please suggest some pointers to debug and resolve this issue. I can
> provide more info if needed.

Can we see the code for your Filter?

Do all of the parameters appear to disappear, or only some of them?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVcIKvAAoJEBzwKT+lPKRY6ioQALCHKEO/7Yj9RCkKXSPoBAOW
ayw8a0Pj802SwxTR1lBhvPf71ZiGqwmGv46a2ZxFDI+N6C0KB+6afI17XeoyjRKV
ieuBypeBpsYijVkwCHFICiwlF8U6fe2ar9KG+Vhffffjz/8DNweVXHtwRHDIK3G+
EQ22qGuyH5ydcw+e3M63hHGwHsLf3YK3akJR5soOAboHTbYADU374vqRmSWlRb70
Lcxq+691cvAbJH6yKen5oo9O+F2aMhMti/rvXrhSRQT2cfWQNKjLWIg7d3CPORsp
6FGpQieCJ/csO/2pBz4RKXopfGcybc5EGjh9uNgqQwmMtBoPHgTy1JWcumX80K3s
tYKYPcexR0qPpIEB76owAvbYUIgdlswhljYT8Wz7Fr7KZbxhFzoAhGSxitJHPgTC
kUmCrFW9ote9Xxn8tRHnVMvT45YVcA6i8vVLczKH/wzyAR/PVpgqI5Xrn+gMHDXH
Ld4XZYpc1xtT5bo1/QdRNoL9rl3TpJvbqCkfPfqNPCEv3vddzjmnmalJnvLbD/7C
Fvy639CaFqxl/0KNBcVsJdMg3JLnoaExa2UY5lpZA6L6rsqkYaQEBmfT97PKwaVp
Z7ftmW9bwTJ6BZArR3z4qEihWwm7AxNIk6sRO+Ef3tH0dIfqixClR+ccNZqNqvBP
fxboiBuGytLH5beNzUqi
=z+IM
-----END PGP SIGNATURE-----

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


Re: Tomcat losing request parameters

Posted by Mark Thomas <ma...@apache.org>.
On 04/06/2015 16:40, Ravi Kiran wrote:
> Hi,
> 
> I am writing to get some pointers on a strange issue which are facing in
> tomcat in one of our client environments.
> 
> Setup: 4 Webservers connecting to 2 tomcat using mod_jk (load balanced)
> 
> Issue: Request parameters GET/POST are coming as null to the application
> intermittently i.e, filter in web app dumps the request parameters and
> finds everything empty. TCP dumps are inspected and packets are reaching
> tomcat even during the failure cases. Parameters are available in tcpdump
> but lost in between before it reaches application. This happens only on one
> specific client environment which makes it even difficult to isolate the
> problem.
> 
> Tomcat Version: 7.0.54
> 
> Please suggest some pointers to debug and resolve this issue. I can provide
> more info if needed.

Update to the latest 7.0.x release just in case there is something that
has been fixed.

It sounds like a timing issue. I'd be checking the app very carefully
for how it handles request and response objects making sure they are not
retained anywhere between requests.

After that, I'd start adding debug log statements to the Tomcat source
(probably not what you want to hear).

Mark


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


Re: Tomcat losing request parameters

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

Ravi,

On 6/9/15 1:48 PM, Ravi Kiran wrote:
> Few things we tried: - Changed mod_jk to mod_proxy where requests
> are passed to tomcat as http:8080 instead of AJP but we still get
> the same issue intermittently. - Enabled failed request filter and
> it doesn't report anything nor stop the requests stating bad
> requests
> 
> unfortunately, running out of options

Have you checked to make sure that the request parameters aren't
illegally-formatted as Konstantin suggested might be the case?

It might help if you provided an example packet capture of a request
whose parameters have been ignored.

Also, are you testing against Tomcat 7.0.latest, or still 7.0.54?

- -chris

> On Tue, Jun 9, 2015 at 9:14 AM, Christopher Schultz < 
> chris@christopherschultz.net> wrote:
> 
> Konstantin,
> 
> On 6/9/15 5:04 AM, Konstantin Kolinko wrote:
>>>> 2015-06-04 18:40 GMT+03:00 Ravi Kiran
>>>> <ra...@gmail.com>:
>>>>> Hi,
>>>>> 
>>>>> I am writing to get some pointers on a strange issue which
>>>>> are facing in tomcat in one of our client environments.
>>>>> 
>>>>> Setup: 4 Webservers connecting to 2 tomcat using mod_jk
>>>>> (load balanced)
>>>>> 
>>>>> Issue: Request parameters GET/POST are coming as null to
>>>>> the application intermittently i.e, filter in web app dumps
>>>>> the request parameters and finds everything empty. TCP
>>>>> dumps are inspected and packets are reaching tomcat even
>>>>> during the failure cases. Parameters are available in
>>>>> tcpdump but lost in between before it reaches application.
>>>>> This happens only on one specific client environment which
>>>>> makes it even difficult to isolate the problem.
>>>>> 
>>>>> Tomcat Version: 7.0.54
>>>>> 
>>>>> Please suggest some pointers to debug and resolve this
>>>>> issue. I can provide more info if needed.
>>>>> 
>>>> 
>>>> 
>>>> The Servlet API has no way to report errors (such as
>>>> IOException) from request.getParameter() family of methods.
>>>> There is a Tomcat-specific request attribute that is set to a
>>>> non-null value when parsing of parameters fails.
>>>> 
>>>> See org.apache.catalina.filters.FailedRequestFilter [1] as a
>>>> sample of code.
>>>> 
>>>> [1] 
>>>> http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Failed_R
equ
>
>>>> 
est_Filter
> 
> +1
> 
> I
>>>> 
> re-read the OP and I was under the impression that the Filter was 
> reading the request parameters properly, but that the servlet was
> then re-reading the parameters and getting nulls.
> 
> Having re-read that, I suspect Konstantin's analysis is correct,
> and that the parameter values were probably broken in some way.
> 
> -chris
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVdyqEAAoJEBzwKT+lPKRYsYgP/0wtTEUpiod6rCofO5xAxomT
gye06hD+0DUNB4L9LwIxni+KSiW/0T85eMkKmD01SSY3wHYVlY792jkptFgB65DA
+UNATRZoiRgclWB1kIXW6IpeAfltFSfDyizj2UrEHX885xuBm4NZ4L4laBuY4aYN
QXmnMmLZQwXw352+GaLB/o8Wwy5l2ehsN80udIHIazbtGiL+KkRYLVAbrrrD0pbW
bt77BShW2spyVog6hGRDC0zDEwD18A7PIMu1ANk1MZC3QJbTUFrHPvVyp/1zz8JK
sgte5pstRawDOVoh135oIVLDs77wCcC+i6LOBils0g65sPEOHTFTkC8E7eALabX4
seIG+UDdLS84S/ZewMUZP2TSBBthMmrxMBsEt5rtlcsy00/VO+0IBct8m0cO20vq
hLEHxm/hFw72ogzs0a65P0HsRt8ay/tBnzE3ERQ3n1iljyWSqWbyFzH27voyWLbm
BhifTML7hVZjDsLK9QScsHCrMYnTJuL/6p1bxeVf5CsdnixC8/u6zpxMlkvjhmW6
NKX+3Jopmjvq7lOSnR6JqZWVHqh3pi1XvLoIHroLOpYT9dQDUtKOqjv0Og6Qt3zv
B08u6y5Q2xlFMtev2vscTKTnObdk6b3e21DHl3x66NP/1iDk6Zl8joE1HuSztNm+
37H0DeidwcwHkf2QdzdZ
=Kxwn
-----END PGP SIGNATURE-----

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


Re: Tomcat losing request parameters

Posted by Ravi Kiran <ra...@gmail.com>.
Few things we tried:
- Changed mod_jk to mod_proxy where requests are passed to tomcat as
http:8080 instead of AJP but we still get the same issue intermittently.
- Enabled failed request filter and it doesn't report anything nor stop the
requests stating bad requests

unfortunately, running out of options

On Tue, Jun 9, 2015 at 9:14 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Konstantin,
>
> On 6/9/15 5:04 AM, Konstantin Kolinko wrote:
> > 2015-06-04 18:40 GMT+03:00 Ravi Kiran <ra...@gmail.com>:
> >> Hi,
> >>
> >> I am writing to get some pointers on a strange issue which are
> >> facing in tomcat in one of our client environments.
> >>
> >> Setup: 4 Webservers connecting to 2 tomcat using mod_jk (load
> >> balanced)
> >>
> >> Issue: Request parameters GET/POST are coming as null to the
> >> application intermittently i.e, filter in web app dumps the
> >> request parameters and finds everything empty. TCP dumps are
> >> inspected and packets are reaching tomcat even during the failure
> >> cases. Parameters are available in tcpdump but lost in between
> >> before it reaches application. This happens only on one specific
> >> client environment which makes it even difficult to isolate the
> >> problem.
> >>
> >> Tomcat Version: 7.0.54
> >>
> >> Please suggest some pointers to debug and resolve this issue. I
> >> can provide more info if needed.
> >>
> >
> >
> > The Servlet API has no way to report errors (such as IOException)
> > from request.getParameter() family of methods.  There is a
> > Tomcat-specific request attribute that is set to a non-null value
> > when parsing of parameters fails.
> >
> > See org.apache.catalina.filters.FailedRequestFilter [1] as a sample
> > of code.
> >
> > [1]
> > http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Failed_Requ
> est_Filter
>
> +1
>
> I
> >
> re-read the OP and I was under the impression that the Filter was
> reading the request parameters properly, but that the servlet was then
> re-reading the parameters and getting nulls.
>
> Having re-read that, I suspect Konstantin's analysis is correct, and
> that the parameter values were probably broken in some way.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJVdxD4AAoJEBzwKT+lPKRYc6sP/RDSV9IeARJXJIo4f6VeRwJv
> S/RcHDq8tmUmT1Z/gvX6nzTeEiHclIXoXMY3AJ0wg0LJHHQHMw+Z5waX1j76/hoQ
> TDmO/qNewqyWnI3oCsg6h7yrjtugs9hsqK77LJCUY0954qrSP/+McKUNQTLW3sGP
> Ik7ImDNaFHGZZvwgaq1DAzL9Sa+QM2XiTZqnM5yxykW2tmy1kOv4/47Pb97NUJyz
> 2C2WjZqgQBIRVOh7L5Wg8tp9SLtZ548oUSJopadoLaqsdvlva8H9v7Lz/ESOS8V8
> 3voPz9owNDn+5E641piv9ykHh86emltFE1uVRaV3ryX1LW11mGi0Qhqhn9DC2U2b
> WeR5VZ0iiSiS/BdnNN+8hnT1o32GquLkJPx4aGco3kjeLV2ADBpTNaAupwYfRl9Y
> NVbM9CZlLR97CPic4qmV1yECgv1UDaSp4sRE5G6SFc1UnxPDUIi2EVAPYthKF66Z
> mtVHBOgwWARGohqlbtjuIugPAOu3RYnV4qg7ZqWfxPrnvXTWjGOETOzeidEdn9hb
> EcXYcTRTShk609vWXA5BvPK/H8eJ3Mg84a0wRex8NdlsuZZaQFd/WfVXvklk5ndl
> ge0siyVLSynHXdjDCnPm5sKyHREyCOUjgYtOQky0b7sHS36i2CPdKH0srQ9DngkY
> +crYqQ+kzEH61VTadc1r
> =JPLZ
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat losing request parameters

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

Konstantin,

On 6/9/15 5:04 AM, Konstantin Kolinko wrote:
> 2015-06-04 18:40 GMT+03:00 Ravi Kiran <ra...@gmail.com>:
>> Hi,
>> 
>> I am writing to get some pointers on a strange issue which are
>> facing in tomcat in one of our client environments.
>> 
>> Setup: 4 Webservers connecting to 2 tomcat using mod_jk (load
>> balanced)
>> 
>> Issue: Request parameters GET/POST are coming as null to the
>> application intermittently i.e, filter in web app dumps the
>> request parameters and finds everything empty. TCP dumps are
>> inspected and packets are reaching tomcat even during the failure
>> cases. Parameters are available in tcpdump but lost in between
>> before it reaches application. This happens only on one specific
>> client environment which makes it even difficult to isolate the 
>> problem.
>> 
>> Tomcat Version: 7.0.54
>> 
>> Please suggest some pointers to debug and resolve this issue. I
>> can provide more info if needed.
>> 
> 
> 
> The Servlet API has no way to report errors (such as IOException)
> from request.getParameter() family of methods.  There is a
> Tomcat-specific request attribute that is set to a non-null value
> when parsing of parameters fails.
> 
> See org.apache.catalina.filters.FailedRequestFilter [1] as a sample
> of code.
> 
> [1]
> http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Failed_Requ
est_Filter

+1

I
> 
re-read the OP and I was under the impression that the Filter was
reading the request parameters properly, but that the servlet was then
re-reading the parameters and getting nulls.

Having re-read that, I suspect Konstantin's analysis is correct, and
that the parameter values were probably broken in some way.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVdxD4AAoJEBzwKT+lPKRYc6sP/RDSV9IeARJXJIo4f6VeRwJv
S/RcHDq8tmUmT1Z/gvX6nzTeEiHclIXoXMY3AJ0wg0LJHHQHMw+Z5waX1j76/hoQ
TDmO/qNewqyWnI3oCsg6h7yrjtugs9hsqK77LJCUY0954qrSP/+McKUNQTLW3sGP
Ik7ImDNaFHGZZvwgaq1DAzL9Sa+QM2XiTZqnM5yxykW2tmy1kOv4/47Pb97NUJyz
2C2WjZqgQBIRVOh7L5Wg8tp9SLtZ548oUSJopadoLaqsdvlva8H9v7Lz/ESOS8V8
3voPz9owNDn+5E641piv9ykHh86emltFE1uVRaV3ryX1LW11mGi0Qhqhn9DC2U2b
WeR5VZ0iiSiS/BdnNN+8hnT1o32GquLkJPx4aGco3kjeLV2ADBpTNaAupwYfRl9Y
NVbM9CZlLR97CPic4qmV1yECgv1UDaSp4sRE5G6SFc1UnxPDUIi2EVAPYthKF66Z
mtVHBOgwWARGohqlbtjuIugPAOu3RYnV4qg7ZqWfxPrnvXTWjGOETOzeidEdn9hb
EcXYcTRTShk609vWXA5BvPK/H8eJ3Mg84a0wRex8NdlsuZZaQFd/WfVXvklk5ndl
ge0siyVLSynHXdjDCnPm5sKyHREyCOUjgYtOQky0b7sHS36i2CPdKH0srQ9DngkY
+crYqQ+kzEH61VTadc1r
=JPLZ
-----END PGP SIGNATURE-----

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


Re: Tomcat losing request parameters

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-06-04 18:40 GMT+03:00 Ravi Kiran <ra...@gmail.com>:
> Hi,
>
> I am writing to get some pointers on a strange issue which are facing in
> tomcat in one of our client environments.
>
> Setup: 4 Webservers connecting to 2 tomcat using mod_jk (load balanced)
>
> Issue: Request parameters GET/POST are coming as null to the application
> intermittently i.e, filter in web app dumps the request parameters and
> finds everything empty. TCP dumps are inspected and packets are reaching
> tomcat even during the failure cases. Parameters are available in tcpdump
> but lost in between before it reaches application. This happens only on one
> specific client environment which makes it even difficult to isolate the
> problem.
>
> Tomcat Version: 7.0.54
>
> Please suggest some pointers to debug and resolve this issue. I can provide
> more info if needed.
>


The Servlet API has no way to report errors (such as IOException) from
request.getParameter() family of methods.  There is a Tomcat-specific
request attribute that is set to a non-null value when parsing of
parameters fails.

See org.apache.catalina.filters.FailedRequestFilter [1] as a sample of code.

[1] http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Failed_Request_Filter

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