Clarify 400 error related to HTTP/2 - #14730
Conversation
|
I should mention that in my case the connection is being made using plain-text HTTP (since this is in a test environment, not production), that the Jenkins controller is not configured to listen to HTTP/2, and the problem occurs whether or not Undertow is configured to allow HTTP/2. Debugging Jetty showed that it was receiving |
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
|
Another update: yesterday I tested the same |
|
@jglick are you able to turn on DEBUG logging in Jetty? If the upgrade fails at the line you modified in this PR, then it is a protocol error from the proxy: either the Or, it is a legit Jetty bug, but we need to know what's going on. |
Sadly, no. I set the system property described in Jetty docs, but it did nothing. Perhaps something wrong with the Jenkins embedding w.r.t. logging framework bridges (Jenkins uses
Yes, that would be the logical next step. Not sure if I can get to it today. |
|
@jglick BTW, we unfortunately cannot accept this PR until you sign the ECA. Let us know if you're willing to do so, otherwise we'll take over: this PR has merit and should be merged, but we cannot merge it in the current state. |
|
OK using sudo tshark -i lo -f "tcp and portrange 30001-65535" -Y "http" -O http(no idea what these options mean but Copilot came up with it and it seems to work) and rerunning my test reproducing the 400, I see the and Undertow contacting Jenkins/Jetty So indeed it seems Undertow is mangling things; if it is not trying to support HTTP/2 then it should just be dropping Anyway, the upshot for Jetty is that it seems to be correct in responding with a 400, and is at fault only for neglecting to offer any hint of what is wrong. |
|
I apparently do not have an ECA on file. It would be a fair amount of work to get one. (#1824 and #4438 were merged without it, but not #13309.) This is just a one-line change that I filed as a PR for concreteness but you can just treat it as a bug report since the code change is obvious if you agree. |
|
I confirm the request from Undertow is wrong, lacking
Correct, we'll fix that.
You mean between you and the company that employs you? In any case, I'll take this over. |
|
Replaced by #14755. |
Right, I need to ask lawyers. Doable, just not worth it for a trivial one-line edit. |
In some Jenkins-related code I ran into an obstacle that a request made by a
java.net.httpclient directly to the Jenkins controller worked fine, but when the same request was run through an Undertow reverse proxy it would fail. The symptom was that Jetty would respond with a 400 error page with no explanation (and no server-side log messages).Earlier I had seen a similar symptom specific to ALB on AWS which I suspect had the same root cause, but unconfirmed; worked around at that time by switching to the
java.netclient, something I just hit upon by accident.jenkinsci/winstone#532 looked like it might help in the newer (Undertow) case, but it did not.
After
I was able to determine that the error was coming from the line of code patched here, introduced in d1e6c77 and retained in #8685. While I do not exactly understand the issue, configuring the client to avoid HTTP/2
solved the problem.
The error page could perhaps include somewhat more information, but I wanted to err on the side of caution when disclosing information to a client; this should be just enough to clue you in that something related to HTTP/2 is involved. Otherwise a 400 error could point to any of a vast array of mistakes.