-
Notifications
You must be signed in to change notification settings - Fork 673
Description
Description:
What issue is being seen? Describe what should be happening instead of
the bug, for example: The expected value isn't returned, etc.
When the only Pod behind a Service goes down and the Service ends up with zero Endpoints, Envoy Gateway returns:
500 Internal Server Error
response_code_details: "direct_response"
upstream_cluster: null
I expected Envoy Gateway to return 503 Service Unavailable (no healthy upstream)
I would like to confirm whether returning 500 direct_response in this scenario is the intended behavior.
Repro steps:
Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.
- Deploy a Service with a single Pod.
- Create an HTTPRoute pointing to that Service.
The route is valid (Accepted=True, ResolvedRefs=True). - Send a request → routing works normally.
- Delete or crash the only Pod.
- Service now has 0 Endpoints.
- Send the same request again.
- Envoy Gateway returns 500 direct_response, and Envoy does not attempt any upstream connection (upstream_cluster=null).
Note: If there are privacy concerns, sanitize the data prior to
sharing.
Environment:
Include the environment like gateway version, envoy version and so on.
envoyproxy-gateway:v1.5.0
envoy:v1.34.1
Logs:
Include the access logs and the Envoy logs.
Envoy access log
{
":authority":"aaa",
"method":"POST",
"protocol":"HTTP/2",
"response_code":500,
"response_code_details":"direct_response",
"upstream_cluster":null,
"upstream_host":null,
"x-envoy-origin-path":"ddd"
}
HttpRoute status:
status:
parents:
- conditions:
- type: Accepted
status: "True"
reason: Accepted - type: ResolvedRefs
status: "True"
reason: ResolvedRefs
- type: Accepted
Is this behavior expected?
Should Envoy Gateway return 503 instead of generating a 500 direct_response when a backend Service has zero Endpoints?