envoyproxy / envoyproxy/envoy

Help: unhandled exceptions and custom content-type in the reverse bridge.

Open
#12,704 4 comments 1 reaction 0 assignees View on GitHub
area/grpc bug help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
428

Description

*Title*: *Help: unhandled exceptions and custom content-type in the reverse bridge.*

*Description*:
>In some unhandled exceptions (i.e.: a 503 upstream not available or internal envoy timeout exceptions) reverse bridge cannot support them due to the response content-type header (`application/grpc`), since we have custom `content-type: application/grpc+proto` in the reverse bridge configuration (our upstream is responding using this `content-type: application/grpc+proto`):

```
Status (StatusCode = Unknown, Detail ="envoy reverse bridge: upstream responded with unsupported content-type application/grpc, status code 200")
```

Would It be possible to do some workaround to convert that response header into application/grpc+proto; since we have no control over those exceptions (upstream not available or envoy timeout exceptions) and we cannot modify the content-type?

Thanks

*Relevant Links*:
>Related issue: https://github.com/envoyproxy/envoy/issues/10986

*Config* (envoy as sidecar):
```
admin:
access_log_path: /dev/null
address:
socket_address:
address: 0.0.0.0
port_value: 9901
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 11111
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stream_idle_timeout: 60.00s
use_remote_address: false
stat_prefix: ingress_http_reverse
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match:
prefix: "/"
route:
cluster: backend
http_filters:
- name: envoy.filters.http.grpc_stats
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_stats.v3.FilterConfig
emit_filter_state: true
stats_for_all_methods: true
- name: envoy.filters.http.grpc_http1_reverse_bridge
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_http1_reverse_bridge.v3.FilterConfig
content_type: application/grpc+proto
withhold_grpc_frames: true
- name: envoy.filters.http.health_check
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck
pass_through_mode: true
- name: envoy.filters.http.router
typed_config: {}
use_proxy_proto: false
clusters:
- name: backend
connect_timeout: 5.00s
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
lb_policy: ROUND_ROBIN
http_protocol_options: {}
load_assignment:
cluster_name: backend
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: localhost
port_value: 8888
```

*Logs*:
```
Status(StatusCode=Unknown, Detail="envoy reverse bridge: upstream responded with unsupported content-type application/grpc, status code 200")
```

**Envoy version**:
>`v1.15.0`

Contributor guide

Open the contributing guide

Research direction

Start with the envoy.filters.http.grpc_http1_reverse_bridge filter and its content_type configuration, using the supplied Envoy v1.15.0 configuration and logs as the reproduction context. Determine how unhandled upstream exceptions with application/grpc are processed when application/grpc+proto is configured. Done requires a maintainer-approved behavior and tests covering the reported exception response.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.