xds server grpc connection issue

16 views
Skip to first unread message

bori...@gmail.com

unread,
Apr 24, 2020, 6:06:46 PM4/24/20
to envoy-dev
I am new to both envoy and grpc. Trying to write a xds_server for VHDS. Here is my relevant config:

static_resources:
  clusters:
  - name: xds_server
    connect_timeout: 0.25s
    type: STATIC
    lb_policy: ROUND_ROBIN
    load_assignment:
      cluster_name: xds_server
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 50051
    transport_socket:
      name: envoy.transport_sockets.tls
      typed_config:
        common_tls_context:
          tls_certificates:
          - certificate_chain:
              filename: ./certs/client.crt
            private_key:
              filename: ./certs/client.key
          alpn_protocols:
            - h2


rds.conf:
{
  "version_info": "0",
  "resources": [
    {
      "name": "vhds_test",
      "virtual_hosts": [
      ],
      "vhds": {
        "config_source": {
          "api_config_source": {
            "api_type": "DELTA_GRPC",
            "transport_api_version": "V3",
            "grpc_services": {
              "envoy_grpc": {
                "cluster_name": "xds_server"
              }
            }
          }
        }
      }
    }
  ]
}

I see envoy trying to talk to the xds_server but the xds_server is printing out this error:
I0424 22:01:42.214966000    3033 chttp2_transport.cc:2904]   transport 0x7fc7dc19ee90 set connectivity_state=4
I0424 22:01:42.215632300    3033 chttp2_transport.cc:1843]   perform_transport_op[t=0x7fc7dc19ee90]: SET_ACCEPT_STREAM:(nil)((nil),...)
I0424 22:01:42.216302600    3033 tcp_posix.cc:857]           TCP:0x7fc7dc16a820 got_error: {"created":"@1587765702.215611500","description":"FD Shutdown","file":"external/com_github_grpc_grpc/src/core/lib/iomgr/lockfree_event.cc","file_line":194,"referenced_errors":[{"created":"@1587765702.214954400","description":"Failed parsing HTTP/2","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":2531,"grpc_status":14,"referenced_errors":[{"created":"@1587765702.214935700","description":"Connect string mismatch: expected 'R' (82) got 'O' (79) at byte 1","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/parsing.cc","file_line":97}]}]}
I0424 22:01:42.216976000    3033 chttp2_transport.cc:2647]   ipv4:127.0.0.1:33866: Complete BDP ping err={"created":"@1587765702.214954400","description":"Failed parsing HTTP/2","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":2531,"referenced_errors":[{"created":"@1587765702.214935700","description":"Connect string mismatch: expected 'R' (82) got 'O' (79) at byte 1","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/parsing.cc","file_line":97}]}


On the enovy side:
[2020-04-24 22:03:41.671][3079][debug][router] [external/envoy/source/common/router/router.cc:477] [C0][S10473609296706210577] cluster 'xds_server' match for URL '/envoy.api.v2.VirtualHostDiscoveryService/DeltaVirtualHosts'
[2020-04-24 22:03:41.672][3079][debug][router] [external/envoy/source/common/router/router.cc:634] [C0][S10473609296706210577] router decoding headers:
':method', 'POST'
':path', '/envoy.api.v2.VirtualHostDiscoveryService/DeltaVirtualHosts'
':authority', 'xds_server'
':scheme', 'https'
'te', 'trailers'
'content-type', 'application/grpc'
'x-envoy-internal', 'true'
'x-forwarded-for', '172.19.0.2'


So, the error from the xds_server is grpc complaining about the POST request instead of a preface request using PRI verb according the Http/2 spec. 
Can some time point me to the right direction on how to resolve this? Thanks.

Andy

Andy Fong

unread,
Apr 24, 2020, 8:37:13 PM4/24/20
to envoy-dev
I am using latest 1.14.1 release build from source for both envoy-static and xds_server using clang on Centos8.

--
You received this message because you are subscribed to a topic in the Google Groups "envoy-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/envoy-dev/13FxJHuwAkE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to envoy-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-dev/ac2a22bb-4b8e-4d35-8a55-87a843b5fddf%40googlegroups.com.

Stephan Zuercher

unread,
Apr 24, 2020, 10:52:30 PM4/24/20
to Andy Fong, envoy-dev
You need to add http2_protocol_options to your xds_server cluster. You needn’t set any of its options (eg http2_protocol_options: {} is sufficient). 

Stephan


On Apr 24, 2020, at 5:37 PM, Andy Fong <bori...@gmail.com> wrote:


You received this message because you are subscribed to the Google Groups "envoy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-dev/CAP%2BbT_Fo-N5AchiVcz9ZwWHLReUhdpD4oQTQfz1%2BMff5HBsF3w%40mail.gmail.com.

Andy Fong

unread,
Apr 25, 2020, 7:33:00 AM4/25/20
to Stephan Zuercher, envoy-dev
Thanks! That fixes the problem.

Andy
Reply all
Reply to author
Forward
0 new messages