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.

Unable to connect to Unix socket using node-grpc client

See original GitHub issue

I am trying to communicate with a server that is listening on a unix socket - if I use TCP I have no issues, but after much effort have been unable to get it working with the unix socket. Code is

    const BIND_SOCKET = '/tmp/collector.sock';
    const BIND_TCP = ':9832'; // works fine if I use this for client + server
    const PROTO_PATH = './Collector.proto';
    const collector = grpc.load({ root: __dirname, file: PROTO_PATH }).collectorv1;

    this.client = new collector.Collector(BIND_SOCKET, grpc.credentials.createInsecure());

I have tried many variations on the socket, such as unix:/tmp/collector.sock and many others I have found online. However none of them work and my write call simply hangs forever, regardless of whether the server is active and listening on the port.

I am using grpc version 1.10.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:66 (21 by maintainers)

github_iconTop GitHub Comments

3reactions
nicolasnoblecommented, Apr 10, 2018

I think we can consider this issue to be an actual feature request 😃 Also it might be easier for us to implement this using the pure-javascript version of the library.

2reactions
jkrylcommented, Mar 19, 2020

@entropitor : Problem with authority header is a story of its own. It is a source of various interoperability issues because the spec does not say what authority header should be if used over UDS. Related issue to grpc implementation in golang (contains a link to rust issue as well) here: https://github.com/grpc/grpc-go/issues/2628.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gRPC: 14 UNAVAILABLE: failed to connect to all addresses
That gRPC error means that no server is running at the address you are trying to connect to, or a connection to that...
Read more >
Agents - Configuration File Reference | Consul
The permissions of the socket file are tunable via the unix_sockets config construct. When running Consul agent commands against Unix socket interfaces, use...
Read more >
Device Plugins | Kubernetes
The plugin starts a gRPC service, with a Unix socket under host path /var/lib/kubelet/device-plugins/ , that implements the following ...
Read more >
unix-socket - npm search
Enables creation and consumption of Unix domain socket based IPC channels between Node.js apps using JSON-RPC 2.0 as a protocol. domain · inter-process ......
Read more >
DogStatsD over Unix Domain Socket - Datadog Docs
Unix Domain Sockets allow you to establish the connection with a socket file, regardless of the IP of ... Then, configure the DogStatsD...
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