grpc-web: proxy: stream terminated by RST_STREAM

I’m trying to get a basic example of grpc-web working in my application. Using the HelloWorld service example from the grpc-node library, and the example code from grpc-web/example, I’ve put together what I think should work. The proxy connects to my server…

time="2018-02-27T18:22:42Z" level=info msg="dialing to target with scheme: \"\"" system=system
time="2018-02-27T18:22:42Z" level=info msg="listening for http_tls on: [::]:8443"
time="2018-02-27T18:22:42Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{stern-server:9000 0  <nil>}]" system=system
time="2018-02-27T18:22:42Z" level=info msg="ClientConn switching balancer to \"pick_first\"" system=system
time="2018-02-27T18:22:42Z" level=info msg="listening for http on: [::]:8080"
time="2018-02-27T18:22:42Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42016e370, CONNECTING" system=system
time="2018-02-27T18:22:42Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42016e370, READY" system=system

When I use the client to make the call, it creates a request like this (copied as cURL from Chrome network log):

curl 'https://localhost:8443/helloworld.Greeter/SayHello' -H 'origin: https://localhost:4200' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36' -H 'content-type: application/grpc-web+proto' -H 'accept: */*' -H 'x-grpc-web: 1' -H 'referer: https://localhost:4200/operations' -H 'authority: localhost:8443' --data-binary $'\x00\x00\x00\x00\x04\n\x02yo' --compressed --insecure

But this is the error message it gives back:

stream terminated by RST_STREAM with error code: INTERNAL_ERROR

That same error shows up in the log output from the proxy itself.

I know my server should work because I created a grpc-node client and it was able to connect just fine.

What could this error indicate? Where should I start looking? I’ve run out of ideas at this point.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 28 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Gentlemen, I’ve applied the patch suggested by @hpidcock and things are functional again. See PR 148.

The project is still alive, and FYI the official gRPC team has been working on gRPC-Web for 2 years now without putting out anything, so I wouldn’t hold my breath for that. They’re moving at a glacial pace as far as I can tell, perhaps dragging their feet and waiting for the Streams API to land in browsers.

It looks like this is a bug that was introduced some time between now and October 27th last year. I say that because I was able to get a working proxy running from this Docker image, last built with the current master code on October 27th.

https://store.docker.com/community/images/jfyne/docker-grpcwebproxy/builds https://github.com/jfyne/docker-grpcwebproxy/commits/master

I’m able to make calls to this build of the proxy server. Here are the commits made to the proxy:

https://github.com/improbable-eng/grpc-web/commits/master/go/grpcwebproxy

Without much knowledge of the code, these two commits look like they’re most likely to have caused a regression:

https://github.com/improbable-eng/grpc-web/commit/5539469b5d7040156fd9c270bf14d77f08e220b1#diff-74efd2d8a9d5e4c02bef1573c46685b4 https://github.com/improbable-eng/grpc-web/commit/595734003c5631cfc448bdf919d0980271130da8#diff-74efd2d8a9d5e4c02bef1573c46685b4

Can one of the devs take a look at those?