Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK) #41

Closed
RobinKamps opened this issue Dec 11, 2020 · 2 comments
Closed

net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK) #41

RobinKamps opened this issue Dec 11, 2020 · 2 comments

Comments

@RobinKamps
Copy link

Hi Semen,

on server side streams with the grpc-web client i cannot get rid of the
net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK) error.
Envoy is set up correctly with stream_idle_timeout: 0s.
For testing purposes a 10s short deadline is added to the GrpcMetadata.
Envoy picks this deadline and ends the stream at this deadline.
However everytime when the stream ends the error net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK) coming from a post request of the grpc service client via https://github.com/ngx-grpc/ngx-grpc/blob/2d9861c1e993a3496cf763e2d4d37231860a5f9e/packages/grpc-web-client/src/lib/grpc-web-client.ts#L96
is showing up in the developer console.


  | scheduleTask | @ | zone-evergreen.js:2845
  | scheduleTask | @ | zone-evergreen.js:389
  | onScheduleTask | @ | zone-evergreen.js:279
  | scheduleTask | @ | zone-evergreen.js:382
  | scheduleTask | @ | zone-evergreen.js:217
  | scheduleMacroTask | @ | zone-evergreen.js:240
  | scheduleMacroTaskWithCurrentZone | @ | zone-evergreen.js:675
  | (anonymous) | @ | zone-evergreen.js:2878
  | proto.<computed> | @ | zone-evergreen.js:971
  | ic | @ | index.js:38
  | Bc | @ | index.js:59
  | (anonymous) | @ | index.js:55
  | push.TxjO.Z.R | @ | index.js:55
  | (anonymous) | @ | ngx-grpc-grpc-web-client.js:83

Line 83 refers to js:

79    serverStream(path, req, metadata, reqclss, resclss) {
80        const descriptor = new MethodDescriptor(path, 'server_streaming', reqclss, resclss, (request) => request.serializeBinary(), resclss.deserializeBinary);
81        return new Observable(obs => {
82            var _a;
83            const stream = this.client.serverStreaming(this.settings.host + path, req, (_a = metadata === null || metadata === void 0 ? void 0 : metadata.toObject()) !== null && _a !== void 0 ? _a : {}, descriptor);
84            stream.on('status', status => obs.next(new GrpcStatusEvent(status.code, status.details, new GrpcMetadata(status.metadata))));
85            stream.on('error', error => {
86                obs.next(new GrpcStatusEvent(error.code, error.message, error.metadata));
87                obs.complete();
88            });
89            stream.on('data', data => obs.next(new GrpcDataEvent(data)));
90            stream.on('end', () => obs.complete());
91            return () => stream.cancel();
92        });
93    }
@smnbbrv
Copy link
Owner

smnbbrv commented Dec 12, 2020

Hi @RobinKamps

this is weird.

However, normally the networking issues are connected to

  • the envoy setup
  • the particular server side implementation
  • client library implementation issues. E.g. some guys had already issues with .net + trailing headers + grpc-web client impl, see Not-OK status from backend does not trigger error callback #4 . Probably it's worth checking underlying library's issues (grpc-web or improbable-eng's grpc-web correspondingly).

It's always hard to debug.

Do you see this error if you run the example in this repo?

@RobinKamps
Copy link
Author

RobinKamps commented Feb 7, 2021

Hi @smnbbrv
thank you very much for your suggestions .
After spending a few hours testing different clients and proxies i got a working solution for my project by switching to grpc-web-proxy or envoy (v3) instead my probably somehow misconfigured setup before (envoy (v2), grpc-web client with a golang server-side-implementation).
Perhaps https://github.com/johanbrandhorst/grpc-web-compatibility-test is interesting for anyone running a grpc-web stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants