I am redirecting the remote schema to an intermittent proxy server. And that proxy server calls the actual remote schema.
excerpt as below
definition:
url: http://app.metrics:8080/remote-schema
timeout_seconds: 60
forward_client_headers: true
customization:
root_fields_namespace: metrics
headers:
- name: REMOTE_SCHEMA_URL
value: http://app.team-metrics.svc.cluster.local:8080/graphql
It works fine locally and also on docker. But when Its deployed on k8s with istio I get the error as below.
Inconsistent object: Error in $: Failed reading: not a valid json value atupstreamconnecterrorordisconnectresetbeforeheaders.resetreason:protocolerror
Can someone please help on understanding what is the problem?
Info: http://app.metrics/ proxy creates a token and passes it to actual remote schema
TL;DR.
Passing the header transfer-encoding: chunked
was creating issue for istio-proxy and I removed it from the response.
Details: The issue was with istio after I analyzed the istio proxy debug logs. Excerpt below.
debug envoy client [C1653] Error dispatching received data: http/1.1 protocol error: unsupported transfer encoding
And I could see the fix here.