We are getting intermittent 400 response errors to some of our requests and I have tried to track down what is the cause of the 400. The access log from tomcat shows the 400 response. So I added in the request-dumper filter for tomcat. Looking at the logs, I'm not getting anything from this filter for when the 400 occurs. In the request-dumper log, the information for the requests that succeeded that were immediately before and after this error are in log, but nothing for the request that generated a 400 response. I'm looking for suggestions on what/how to track this down in tomcat. I thought the request-dumper would do it, but as I said nothing is generated in that log.
Asked
Active
Viewed 2,625 times
4
-
400 is a bad request. The fact that you say there is nothing for the request that generated the 400 seems to be an answer itself. – stdunbar Jun 18 '20 at 16:23
-
The tomcat access log has the get URL listed with a 400 response. We can use that same URL and paste in a browser and it works. – Laura Jun 18 '20 at 16:30
-
But was there supposed to be something sent and it's not? i.e. is this a call that is expecting, for example, a POST body of JSON and it's not there? – stdunbar Jun 18 '20 at 16:32
-
It's a get request. I've done research into potential reasons for a 400. URL is good. Sometimes the exact same thing works. I want to see, are we overrunning our cookies? Is our length that we are say we are sending different than what we actually send? So I need to see what the actual headers are sending. What are the cookies... – Laura Jun 18 '20 at 16:54
-
What version of Tomcat are you using? According to [this post](https://stackoverflow.com/questions/17545691/how-to-log-all-headers-of-request-response-in-tomcat-7/19732912) the headers should be dumped. – stdunbar Jun 18 '20 at 17:30
-
looks like 7.0.63 – Laura Jun 18 '20 at 19:42
-
I have the same issue with tomcat9 @Laura did you finally figured out the cause? – Martín Alcubierre Nov 18 '22 at 11:00
1 Answers
0
I am also facing the same issue after upgrading the tomcat from Tomcat_7 to Tomcat_9 for our API. The same code was working fine in version 7. It is a GET call from a frontend application which makes a to the API which is running on TC_9. Now the Tomcat-9 that hosts the API is rejecting the call with 400 bad request
One thing to note - One of the query parameter in the URL has a lot of (around 60-70) comma separated values like this https://?custId=value1&attribute=v1,v2,v3,v4,..........,v70
Due to this Total number of text characters in the entire URL is around 4000+

Ayaskant
- 459
- 1
- 5
- 11