grpc-node: server.bind () throwing error
Problem description
I am trying to execute the simple example with greeter client and server. I downloaded all the affiliated files but when I am trying to run the greeter_server.js the following error throws
E1205 11:21:28.876231206 9372 server_chttp2.cc:40] {"created":"@1575537688.876213239","description":"No address added out of total 1 resolved","file":"../deps/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc","file_line":394,"referenced_errors":[{"created":"@1575537688.876211844","description":"Failed to add port to server","file":"../deps/grpc/src/core/lib/iomgr/tcp_server_custom.cc","file_line":404,"referenced_errors":[{"created":"@1575537688.876208981","description":"Failed to initialize UV tcp handle","file":"../deps/grpc/src/core/lib/iomgr/tcp_uv.cc","file_line":72,"grpc_status":14,"os_error":"address family not supported"}]}]}
Reproduction steps
Give very precise steps you’ve discovered to reproduce your problem. If possible and applicable, provide us with a repository we can clone that contains a reproduction case. Also if possible and applicable, please include a Dockerfile that exhibits the problem if it’s specific to a certain environment. Bug reports with no reproduction steps will be closed.
Environment
- Linux Ubuntu 18.04.3 LTS amd64
- Node version: v12.13.1
- Node installation method: Do not remember
- Package name and version : grpc@1.25.0-pre1
Additional context
the line that throws the error in my code is this:
server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
I also tried 127.0.0.1:50051
but the result remains the same
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 17 (4 by maintainers)
I managed to bypass this by migrating to grpc/grpc-js instead of using the c-core version.
I’m seeing a similar issue on grpc=1.24.2. Is there a way to have a nodejs gRPC server explicitly bind to ipv4 address?
If you experienced this bug in the
grpc
package, then as stated above, the package is deprecated and we will not be fixing it. If you are experiencing this bug in the@grpc/grpc-js
package, it is actually a different bug, so please file another issue with the details.Not really. Only API change was around using ‘bindAsync’ instead of ‘bind’