Error callback never invoked for some classes of server response.
See original GitHub issueI have a grpc-web server that is returning 200 OK, and grpc-status / grpc-message, but the client javascript is failing to parse it. The observed behavior is that client requests never receive a completion callback from the library. See the request/response sample below.
The case below is likely related to: https://github.com/google/closure-library/issues/946 , however a quick review of the code suggests there may be more cases like this; unexpected server responses aren’t correctly handled.
Request URL: http://localhost:8090/derp.EchoService/Echo
Request Method: POST
Status Code: 200 OK
Remote Address: 127.0.0.1:8090
Referrer Policy: no-referrer-when-downgrade
Response Headers:
access-control-allow-credentials: true
access-control-allow-origin: null
content-length: 0
content-type: application/grpc-web+proto
date: Thu, 20 Dec 2018 19:25:32 GMT
grpc-message: upstream connect error or disconnect/reset before headers
grpc-status: 14
server: envoy
Provisional headers are shown
Content-Type: application/grpc-web+proto
grpc-timeout: 999m
Origin: null
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
X-Grpc-Web: 1
X-User-Agent: grpc-web-javascript/0.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:17
Top Results From Across the Web
Why is server.close callback never invoked? - Stack Overflow
To test this I am making a single request which throws an error. The process is only closed after the timer expires (10...
Read more >Better Error Handling In NodeJS With Error Classes
This article is for JavaScript and NodeJS developers who want to improve error-handling in their applications.
Read more >Top 10 Most Common Node.js Developer Mistakes - Toptal
Mistake #2: Invoking a Callback More Than Once This is because calling the callback doesn't automatically end the execution of the current function....
Read more >Error handling with promises - The Modern JavaScript Tutorial
Promise chains are great at error handling. When a promise rejects, the control jumps to the closest rejection handler.
Read more >Troubleshoot invocation issues in Lambda
Invocation errors can be caused by issues with request parameters, event structure, function settings, user permissions, resource permissions, or limits. If you ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @y3llowcake ! I don’t kown if my problem is in the scope of this issue but here is the explanation: I have a gRPC server written in Go, my proxy is
envoy
, and I use the JS client ofgrpc-web
in this mode:import_style=commonjs,mode=grpcwebtext
.If my server resturns a gRPC error, the JS Client don’t handle the error. For example, this call returns a valid GRPC error in headers:
but my client don’t handle it:
(In this case, none of my
console.log
was called…)What do you think ? 😃 Thanks !
@skyjia Could you let me know what exactly the incorrect configuration was? We have been stuck with this same problem in our app and seem to have a similar environment as you do.
Thanks in advance!