question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

request failure using the pure js server code

See original GitHub issue

Problem description

I’m seeing silent failures when using the pure js implementation but the grpc package works fine.

Reproduction steps

I’m writing an authentication plugin to work with envoy (https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto). I have a local client I used to invoke the service locally (using the pure js code) and that works just fine. However when the service is invoked by envoy itself I get silent failures (callback is never invoked, connection is showing as reset on the envoy side). After scratching my head for far too long I decided to try the the c-based package and immediately it worked successfully.

Environment

  • OS name, version and architecture: arch
  • Node version 12
  • Node installation method pacman
  • Package name and version [e.g. gRPC@1.12.0]
    "@grpc/grpc-js": "^1.3.2",
    "grpc": "^1.24.10",

Additional context

tcpdump appeared to show the pure js package responding at least to a HEAD request coming from envoy (something my local client doesn’t do) but for some reason I’m not getting much more than that.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:33 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
murgatroid99commented, Mar 7, 2022

The document I linked is an official specification of gRPC behavior, and as far as I know, all of the official libraries, including the one for Go, are implemented in accordance with it.

1reaction
murgatroid99commented, Mar 6, 2022

I want to comment on something you mentioned in the Node issue:

@grpc/grpc-js should probably default to adding unix:// to the server/client when the path looks like a uds (or does not look like a host:port). maybe this should be left to higher-level code?

We intentionally do not do this. We don’t have any complex heuristics at all when handling target addresses. We just default to DNS, which is the behavior specified in this document:

The URI scheme indicates what resolver plugin to use. If no scheme prefix is specified or the scheme is unknown, the dns scheme is used by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ajax fail recursive pure javascript
I try to make two async ajax calls inside ajax call to my own servers, in case of outer ajax call did not...
Read more >
Using XMLHttpRequest - Web APIs | MDN
In this guide, we'll take a look at how to use XMLHttpRequest to issue HTTP requests in order to exchange data between the...
Read more >
How do I send a POST request using JavaScript?
In order to send the HTTP POST request using the JavaScript fetch() ... that is used to communicate with the server in pure...
Read more >
Simple Ajax file upload with pure JavaScript example
Uploading files to the server need not be a problem. The easiest and simplest way for a developer to accomplish an Ajax file...
Read more >
5 ways to make HTTP requests in JavaScript
log("Network error occurred") } //triggered periodically as the client receives data //used to monitor the progress of the request xhr.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found