Hello Tyk community,
I hope you’re all doing well. We are currently facing a critical issue with our Tyk Gateway setup running in a Docker and Kubernetes cluster environment. The problem arises specifically when the backend service takes more than 3 minutes to return the response. We are seeking some guidance and insights from the community to help us resolve this issue.
Problem Description: We have deployed Tyk Gateway as part of our API infrastructure in a Dockerized Kubernetes cluster. The Tyk Gateway is responsible for proxying requests to an upstream backend API. When the backend service takes more than 3 minutes to process the request and return the response, we encounter an “unexpected end of stream” error. This issue is consistent across different clients and tools, as we encountered the same problem when making requests from both a Java client and Postman.
Deployment Environment:
- Kubernetes Cluster Environment
- Dockerized Tyk Gateway Deployment
Observations:
- The Tyk Gateway logs indicate that the request is being successfully received, and it forwards the request to the upstream backend API. The backend API also seems to receive the request.
- However, when the response time from the backend API exceeds 3 minutes, the response from Tyk Gateway is not being read correctly by the client (Java code and Postman). Instead, it throws an “unexpected end of stream” exception.
- Notably, the response time recorded in the Tyk Gateway logs is consistent with the backend response time, which exceeds 3 minutes for requests that encounter the error.
What We’ve Tried:
- We have thoroughly inspected our Java client code and Postman configurations to rule out any issues on the client-side.
- We increased the timeout settings in the Tyk Gateway (e.g., response_timeout) to values exceeding 3 minutes, but the issue persists for long response times.
- We verified the backend API responses by making direct requests to the backend API through Postman, and the responses appear to be well-formed and as expected for both short and long response times
We seek your expertise and suggestions to help us understand if there are any specific Tyk Gateway configurations or Kubernetes settings that might be contributing to this problem. Any insights or recommendations to address this issue would be greatly appreciated.
Thank you in advance for your support.