envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.95k stars 4.8k forks source link

DubboProxyValidationError.StatPrefix: ["value length must be at least " '\x01' " bytes"] #7799

Closed x15zhang closed 5 years ago

x15zhang commented 5 years ago

I am running envoy v1.11.0 with dubbo config as following:

admin:
  access_log_path: /tmp/admin_access.log
  address:
    socket_address: { address: 127.0.0.1, port_value: 15000 }
static_resources:
  listeners:
  - name: dubbo-demo
    address:
      socket_address: { address: 0.0.0.0, port_value: 15001 }
    filter_chains:
    - filters:
      - name: envoy.filters.network.dubbo_proxy
      config:
        stat_prefix: dubbo_incomming_stats
        protocol_type: Dubbo
        serialization_type: Hessian2
        route_config:
          name: local_route
          interface: com.example.service.Greetings
          routes:
          - match:
              method:
                name:
                  exact: say
            route:
              cluster: producer
        dubbo_filters:
        - name: envoy.filters.dubbo.router
  clusters:
    - name: producer
      connect_timeout: 5s
      type: LOGICAL_DNS
      # Comment out the following line to test on v6 networks
      dns_lookup_family: V4_ONLY
      lb_policy: ROUND_ROBIN
      hosts: [{ socket_address: { address: 172.16.0.16, port_value: 20880 }}]

and I get bellow error: [2019-08-01 14:46:28.008][9713][info][upstream] _[external/envoy/source/common/upstream/cluster_manager_impl.cc:148] cm init: all clusters initialized [2019-08-01 14:46:28.008][9713][info][config] [external/envoy/source/server/configurationimpl.cc:71] loading 1 listener(s) [2019-08-01 14:46:28.009][9713][critical][main] [external/envoy/source/server/server.cc:93] error initializing configuration 'dubbo.yaml': Proto constraint validation failed (DubboProxyValidationError.StatPrefix: ["value length must be at least " '\x01' " bytes"]): [2019-08-01 14:46:28.009][9713][info][main] [external/envoy/source/server/server.cc:560] exiting Proto constraint validation failed (DubboProxyValidationError.StatPrefix: ["value length must be at least " '\x01' " bytes"]):

zyfjeff commented 5 years ago

I suspect there are some problems with the format of your YAML file. cat -A yam_file

x15zhang commented 5 years ago

I used yaml validation tool to validate it and the result shows it is valid.

lizan commented 5 years ago

@x15zhang you have to specify stat_prefix for dubbo filter. it is required: https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/dubbo_proxy/v2alpha1/dubbo_proxy.proto#envoy-api-msg-config-filter-network-dubbo-proxy-v2alpha1-dubboproxy

x15zhang commented 5 years ago

It is the format issue because name and config is not aligned. Thanks @lizan and @zyfjeff for clarifing.