-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failed to exec into task: malformed HTTP response #10922
Comments
Just tested using client
With Nomad client
|
Confirmed -- works on Nomad 1.1.1, fails to exec on 1.1.2: # Nomad v1.1.1
$ nomad --version
Nomad v1.1.1
$ nomad exec -task $TASK -namespace $NS $ALLOC /bin/bash
bash-4.4$
# Nomad v1.1.2
$ nomad --version
Nomad v1.1.2
$ nomad exec -task $TASK -namespace $NS $ALLOC /bin/bash
failed to exec into task: unexpected EOF
|
Thanks for reporting the bug. I'll look into it this week. |
So I have tried to reproduce this without much luck sadly. I would appreciate more context here:
In my setup, I have tried a 3 server 2 client clusters, all running 1.1.2, with and without mutual TLS. Thanks again! |
Hi @notnoop, we're seeing this with I see what you mean, it's hard to reproduce for me as well. Running Nomad locally or logging into a Nomad client and running CLI v1.1.2 (macOS) -> AWS ALB -> Nomad server v1.1.2 (Ubuntu 18.04) I can confirm this does work when the CLI version is v1.1.1 and Nomad server is still 1.1.2. I'll continue to poke around a bit to see if I can find a way to reliably reproduce the issue. |
@evandam That is very useful info! My hunch is that it's related attempting http/2 connections change in https://github.com/hashicorp/nomad/pull/10778/files#r653842473 . Can you try compiling latest diff --git a/api/api.go b/api/api.go
index d1f985dbe..a69c32ead 100644
--- a/api/api.go
+++ b/api/api.go
@@ -248,6 +248,7 @@ func defaultHttpClient() *http.Client {
transport.TLSClientConfig = &tls.Config{
MinVersion: tls.VersionTLS12,
}
+ transport.ForceAttemptHTTP2 = false
return httpClient
} As a matter of convenience, I have built binaries as CI artifacts:
I'm also going to test having Nomad behind AWS ALB as well. Thanks for the pointers. |
@notnoop this works perfectly with the macOS binary you built 😄 |
That's excellent to hear! I'll research the cause of http/2 being problematic here - and we will have a release with a fix very soon! Thank you so much for the quick validation! |
thanks a lot @notnoop 💛 |
A quick update. I have reproduced the failure with ALB as well. Found out that the websocket libraries don't support http/2: gorilla/websocket#417 , and it doesn't seem to fallback to http/1 gracefully . I'm inclined to rollback to defaulting to http/1 after all. Thanks for your patience. |
Thanks @notnoop for the update. |
* api: revert to defaulting to http/1 PR #10778 incidentally changed the api http client to connect with HTTP/2 first. However, the websocket libraries used in `alloc exec` features don't handle http/2 well, and don't downgrade to http/1 gracefully. Given that the switch is incidental, and not requested by users. Furthermore, api consumers can opt-in to forcing http/2 by setting custom http clients. Fixes #10922
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Nomad version
Nomad v1.1.2
Operating system and Environment details
MacOS / Ubuntu
Issue
We just upgraded Nomad from 1.0.4 to 1.1.2 and we can't
alloc exec
into tasks anymore.Nomad Server logs (if appropriate)
Can't find any error on server side.
Nomad Client logs (if appropriate)
The text was updated successfully, but these errors were encountered: