envoyproxy/envoy

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

Open

#12,704 opened on Aug 18, 2020

View on GitHub
 (4 comments) (1 reaction) (0 assignees)C++ (5,373 forks)batch import
area/grpcbughelp wanted

Repository metrics

Stars
 (27,997 stars)
PR merge metrics
 (Avg merge 8d) (378 merged PRs in 30d)

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