Giter Club home page Giter Club logo

envoy-no-status-decode-repro's Introduction

Summary

nodejs sends %-encoded grpc message trailers, and envoy does not decode them when transcoding to json

json to node via envoy

This shows the issue: we're hitting a nodejs grpc upstream (using https://www.npmjs.com/package/@grpc/grpc-js), with envoy doing the json transcoding.

curl -v -H 'cluster: echojs' http://127.0.0.1:8180/echo/echo

{"code":5,"message":"#%20node:%20here's%20an%20error%20message%20with%20spaces%20&%20some%20interesting%20characters!","details":[]}* Closing connection 0

node returns %-encoded headers, but this is apparently expected as eg. grpcurl decodes before printing. Envoy should do this decoding as well.

This commit seems to fix the issue: https://github.com/kentik/envoy/commit/d1b24e225039c0ea98f6fe7f62c9ae83b7ca655b

json to go via envoy

The same call to a go upstream looks fine (b/c the go grpc impl doesn't percent encode grpc status message headers)

curl -v -H 'cluster: echo' http://127.0.0.1:8180/echo/echo

{"code":5,"message":"# here's an error message with spaces & some interesting characters!","details":[]}

pcaps show how these headers look different on the wire

Node: Header: grpc-message: #%20node:%20here's%20an%20error%20message%20with%20spaces%20&%20some%20interesting%20characters!

Go: Header: grpc-message: # here's an error message with spaces & some interesting characters!

See go.pcap, node.pcap and Decode.md

grpcurl decodes correctly

grpc to node upstream via envoy

grpcurl -H 'cluster: echojs' -plaintext -protoset echo/proto.pb localhost:8180 grpcecho.EchoService.Echo

ERROR:
  Code: NotFound
  Message: # node: here's an error message with spaces & some interesting characters!

grpc to go upstream via envoy

grpcurl -H 'cluster: echo' -plaintext -protoset echo/proto.pb localhost:8180 grpcecho.EchoService.Echo

ERROR:
  Code: NotFound
  Message: # here's an error message with spaces & some interesting characters!

grpc direct to node upstream

grpcurl -plaintext -protoset echo/proto.pb localhost:8998 grpcecho.EchoService.Echo

ERROR:
  Code: NotFound
  Message: # node: here's an error message with spaces & some interesting characters!

grpc direct to go upstream

grpcurl -plaintext -protoset echo/proto.pb localhost:8999 grpcecho.EchoService.Echo

ERROR:
  Code: NotFound
  Message: # here's an error message with spaces & some interesting characters!

envoy-no-status-decode-repro's People

Contributors

stfp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.