I am trying to expose the default Jaeger client via the istio ingress gateway and am getting an error I cannot understand. With curl it seems to work normally.
However in the browser I am seeing 503 with the error ‘upstream connect error or disconnect/reset before headers. reset reason: connection termination’
I am a little unsure how to go about debugging this. Trying working out how to enable access logs for envoy is really confusing me - … ???
$ istioctl version
client version: 1.4.0-beta.5
control plane version: 1.4.0-beta.5
Error: 1 error occurred:
* error execing into istio-pilot-5db477d8d7-gsdmn discovery container: unable to upgrade connection: container not found (“discovery”)
It’s a bug in Envoy. It doesn’t support/screws up Application-Layer Protocol Negotiation(ALPN) If you have a http1.1 service in the backend and a client sending Upgrade: h2c - Envoy will upgrade the connection to http2 and then force the backend to use http2 even if its not supported.
Hmm, it seems that this has been a problem in Envoy for a while. Did this start happening since you upgraded? What is the version that you’re upgrading from?
i can confirm that with a downgrade to istio v1.3.5 everything works as expected again. I was trying an upgrade to v1.4 so it was using whatever Envoy that version of Istio’s mesh uses. Thanks for tracing down this issue, very interesting bug because around half of my services were still working (probably because they supported HTTP2).
Drove me crazy because HTTP still worked, and I thought it was a mismanaged cert or an issue with istio’s SDS service.
Check by changing the port name of the jaeger service from ‘query-http’ to ‘http-query’.
It seems that from istio 1.4, when the naming convention is not followed it uses the same protocol as in input so http2 if you use https to access the gateway.
When specifying http-query, envoy will know that the backend it http1.1 and not http2 and will sned the request accordingly.
The issue still persists with Istio 1.4.1 , HTTPS fails with ‘upstream error’ whereas HTTP goes through. Everything works well with 1.3.5 and 1.3.6 . @mooperd have you found some solution ?
In my case Upstream connect error or disconnect/reset before headers. reset reason: connection termination was returned in case when containerPort in POD is set to incorrect value.
You can simulate this by adjusting incorrect value within httpbin pod
apiVersion: v1
kind: Service
metadata:
name: httpbin
labels:
app: httpbin
spec:
ports:
- name: http
port: 8000
targetPort: 8080 # would be 80 viz below
selector:
app: httpbin
---
....
containers:
- name: httpbin
image: docker.io/kennethreitz/httpbin
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080 #httpbin is running on 80
i confirm this. The bug is not a bug but a behavior, which is expected, when the configuration is not
clean and ISTIO works more restricted. I like that.
Well, we worked hard to fix the issue and solved it with the forum thread. So, naming the ports in the
service definition right fix your issue.
In our case switched the ISTIO framework the http1.1 traffic automatically to http2 and the service ot
disrupted.
We are seeing this same problem with 1.4.6 and we have the port named correctly. We are using https and would like to force http1.1 using browser. Is that possible?