Grpc-web: grpcwebproxy closes stream after a while

Created on 16 Sep 2018  路  8Comments  路  Source: improbable-eng/grpc-web

Hello,

I took normal grpc server from this issue #48 (it's based on the example book server) to test how streams work via grpcwebproxy and added channel to emulate periodic pushes from server to client.

It works fine, but after a while (after some received updates) I got an error in the browser

POST http://localhost:8080/examplecom.library.BookService/QueryBooks net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)

And grpcwebproxy output is

INFO[0014] finished streaming call                       error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.method=QueryBooks grpc.service=examplecom.library.BookService grpc.start_time="2018-09-16T16:51:12+03:00" grpc.time_ms=10001 span.kind=server system=grpc

I run grpcwebproxy as grpcwebproxy --backend_addr=localhost:9090 --run_tls_server=false

When I connect directly to the go server from the example, streams work fine without any errors.

Why grpcwebproxy cancels stream or am I do something wrong? And how can I keep stream open until next update will be send?

If you need any additional info, let me know.

Thanks for help

help-wanted kinbug

Most helpful comment

@Revinand You are having the same issue I was having. This solved it for me
https://github.com/improbable-eng/grpc-web/issues/171#issuecomment-392220446

All 8 comments

Hi! Instinctively it looks to me like the browser cancelled the request. Can you create a minimal reproducible example? In a repo, let's say. It would make this easier to debug.

https://github.com/Revinand/grpc-web-stream-proxy-example here I uploaded working example. Like I said it is based on grpc-web/example project, but with grpcwebproxy in the middle. I added a note that grpcwebproxy binary should be linked into /usr/local/bin directory to be available globally. Tell me if you'll have any problems

This is great, thanks. I don't know if we'll have time to look at it but it should be easy to reproduce and debug. Would you be interested in contributing a fix?

I don't know if we'll have time to look at it

No problems

Would you be interested in contributing a fix?

If I'll find a solution, I'll create a PR of course. But I'm not a good golang developer, so...)

Hi there, I too have been getting this exact issue, with the same error outputs from grpcwebproxy and the browser.

Would love to also help out. Will look deeper into this later this week. I wonder if this is some type of context-based timeout.

@Revinand You are having the same issue I was having. This solved it for me
https://github.com/improbable-eng/grpc-web/issues/171#issuecomment-392220446

Ah, so this is a configuration setting? I'll close this issue then.

@KShoukry thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igorgatis picture igorgatis  路  4Comments

hectim picture hectim  路  5Comments

mier85 picture mier85  路  16Comments

nhooyr picture nhooyr  路  20Comments

dweemx picture dweemx  路  17Comments