We are using apache http server 2.4.41, we came across the issue when tomcat is sending the data as "Transfer-Encoding: chunked" without "Content-Length", apache is splitting the data or dropping the connection when the message body length is more, we tried increasing max_buffer_size nothing helped. Below is the error seen on log file. [Tue Dec 17 21:21:09 2019] [63993:140737136023296] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (1409): (node2) wrong message size 18986 8192 from XX.XXX.XX.XXX:XXXX [Tue Dec 17 21:21:09 2019] [63993:140737136023296] [error] ajp_get_reply::jk_ajp_common.c (2286): (node2) Tomcat is down or network problems. Part of the response has already been sent to the client [Tue Dec 17 21:21:09 2019] [63993:140737136023296] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (1409): (node2) wrong message size 18986 8192 from XX.XXX.XX.XXX:XXXX [Tue Dec 17 21:21:09 2019] [63993:140737136023296] [error] ajp_get_reply::jk_ajp_common.c (2286): (node2) Tomcat is down or network problems. Part of the response has already been sent to the client [Tue Dec 17 21:21:09 2019] [63993:140737136023296] [error] ajp_service::jk_ajp_common.c (2796): (node2) connecting to tomcat failed (rc=-11, errors=1, client_errors=0). Note: Tomcat is neither down nor network issues is observed. We have been noticing only when response message(json) is exceeding 8k. Is there a workaround for this or any bugs identified in this version?
The "wrong message size" message shows that Tomcat is configured to use a non-default increased message size and mod_jk still uses the smaller default message size. That won't work. You should first try with both sides using the default size and post the ligs again of the problem persists. Drop "packetSize" from the AJP connector(s) config in Tomcat's server.xml and max_packet_size from any mod_jk workers configuration. I will also switch this bug to Tomcat, because mod_jk is provided by the Tomcat project. Regards, Rainer
Thanks i removed packet size from tomcat and apache. Post that when i try to hit the apache url am getting below error using curl and browser it shows "SyntaxError: JSON.parse: unexpected end of data...." on response tab F12. Curl Error: < HTTP/1.1 200 200 HTTP/1.1 200 200 < Date: Thu, 19 Dec 2019 01:56:35 GMT Date: Thu, 19 Dec 2019 01:56:35 GMT < Server: Apache/2.4.41 (Unix) mod_jk/1.2.46 Server: Apache/2.4.41 (Unix) mod_jk/1.2.46 < Transfer-Encoding: chunked Transfer-Encoding: chunked < Content-Type: application/json Content-Type: application/json < * Problem (2) in the Chunked-Encoded data * Closing connection 0 curl: (56) Problem (2) in the Chunked-Encoded data mod_jk.log: [Wed Dec 18 20:59:57 2019] [61404:140737068881664] [debug] ajp_process_callback::jk_ajp_common.c (2132): (node2) AJP13 protocol: Reuse is OK [Wed Dec 18 20:59:57 2019] [61404:140737068881664] [debug] ajp_reset_endpoint::jk_ajp_common.c (848): (node2) resetting endpoint with socket 41 [Wed Dec 18 20:59:57 2019] [61404:140737068881664] [debug] ajp_done::jk_ajp_common.c (3288): recycling connection pool for worker node2 and socket 41 [Wed Dec 18 20:59:57 2019] [61404:140737068881664] [debug] jk_handler::mod_jk.c (2975): Service finished with status=200 [Wed Dec 18 20:59:57 2019] wizui_router 0.141739 However when i try to hit the direct tomcat url endpoint am getting the proper response back. Looks like apache is splitting the single response to multiple. Please suggest Thanks, Vinoth
Thanks for retrying with default packet sizes. This should work, because Transfer-Encoding chunked is quite normal. So we seem tl have a specific problem with your setup. Could you post your mod_jk config, especially workers.properties or similar and your Tomcat version and AJP connector config in server.xml. Plus please also redo once with JkLogLevel trace. Be warned though, that this wil also write the packet contents into the mod_jk log file, so you shouldn't use secret data in theat test. We would also need the mod_jk log file from the restart to the end of the test request/response. If you don't want to POST publicly, you can also send to me directly (rainer.jung@kippdata.de). Plus please also the Apache httpd error log file(s) and everything that is in the Tomcat aor application logs about that request (especially errors and/or exception stacks etc.). Thanks and regards, Rainer
Hi Rainer, Did you get a chance to look at it? Thanks
Hi Rainer, Did you get a chance to look at it? Thanks (In reply to Rainer Jung from comment #3) > Thanks for retrying with default packet sizes. > > This should work, because Transfer-Encoding chunked is quite normal. So we > seem tl have a specific problem with your setup. > > Could you post your mod_jk config, especially workers.properties or similar > and your Tomcat version and AJP connector config in server.xml. Plus please > also redo once with JkLogLevel trace. Be warned though, that this wil also > write the packet contents into the mod_jk log file, so you shouldn't use > secret data in theat test. We would also need the mod_jk log file from the > restart to the end of the test request/response. If you don't want to POST > publicly, you can also send to me directly (rainer.jung@kippdata.de). Plus > please also the Apache httpd error log file(s) and everything that is in the > Tomcat aor application logs about that request (especially errors and/or > exception stacks etc.). > > Thanks and regards, > > Rainer
(In reply to Rainer Jung from comment #3) > Thanks for retrying with default packet sizes. > > This should work, because Transfer-Encoding chunked is quite normal. So we > seem tl have a specific problem with your setup. > > Could you post your mod_jk config, especially workers.properties or similar > and your Tomcat version and AJP connector config in server.xml. Plus please > also redo once with JkLogLevel trace. Be warned though, that this wil also > write the packet contents into the mod_jk log file, so you shouldn't use > secret data in theat test. We would also need the mod_jk log file from the > restart to the end of the test request/response. If you don't want to POST > publicly, you can also send to me directly (rainer.jung@kippdata.de). Plus > please also the Apache httpd error log file(s) and everything that is in the > Tomcat aor application logs about that request (especially errors and/or > exception stacks etc.). > > Thanks and regards, > > Rainer Hi Rainer, Still waiting for your input. Thanks
If you can share the data publicly, more of us can help you. Failing that send it to me (markt@apache.org) and I'll share it with other Tomcat committers who want to investigate this issue.
Does this work for mod_proxy_http. It received a lot of decent updates recently...
(In reply to Mark Thomas from comment #7) > If you can share the data publicly, more of us can help you. Failing that > send it to me (markt@apache.org) and I'll share it with other Tomcat > committers who want to investigate this issue. Thanks Mark. Was able to identify the issue, looks like has duplicate header on the request 'Transfer Encoding: Chunked' twice. "Header unset Transfer-Encoding" on apache fixed the issue. However further digging why duplicate header is being generated. Thanks
Thanks for the update. Not a Tomcat issue then so closing.
Hi, this ticket has been resolved as INVALID because it's an httpd issue, but there's no related Apache httpd ticket where I could follow up (or I don't see it).