On 28 Nov 2023, at 21:10, Graham Leggett <minf...@sharp.fm.INVALID> wrote:

> So the reason we get a 400 Bad Request with no error detail is that we arrive 
> at this line with throwable set to null:
> 
> https://github.com/apache/tomcat/blob/9.0.x/java/org/apache/catalina/valves/ErrorReportValve.java#L129
> 
> With no throwable we are eventually led here, which is our generic “an error 
> has occurred, not telling you what it is” page:
> 
> https://github.com/apache/tomcat/blob/9.0.x/java/org/apache/catalina/valves/ErrorReportValve.java#L169

I think I've figured out what is happening, I've not yet figured out why it is 
happening, but we’ve got further.

In my case, a jersey-client v3 API is generating a big non-pretty blob of XML 
on one line (no newlines), and is passing this in a POST request to tomcat9 
listening on a unix domain socket.

If I hijack the unix domain socket with socat, I only see 4096-ish bytes being 
received of a body of size approx 1/4MB (from Content-Length, not chunked). 
This looks suspiciously like the size of one write. Why that’s happening is a 
jersey-client question.

In tomcat9 however, it appears that tomcat is seeing 4096-ish bytes, a closed 
and truncated connection (we have a Content-Length so tomcat9 knows it’s 
truncated), tomcat9 is correctly picking up the request body is too small, and 
is correctly returning 400 Bad Request, but there is no exception or detail 
string, so the admin has no idea this is what’s wrong.

Regards,
Graham
—


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

Reply via email to