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

Is there any way to start node.js grpc server with tcp ipv4 mode? #59

Open
nandychen opened this issue Sep 30, 2019 · 0 comments
Open

Comments

@nandychen
Copy link

The details is that the node.js grpc server is started as below

server.bind('0.0.0.0:50051',
            grpc.ServerCredentials.createInsecure())

Next, when i check the listen port by netstat -tuln, get below result which shows the port is listened by ipv6(tcp6) mode:

tcp6       0      0 :::50051                :::*                    LISTEN 

Actually, my docker env does not support ipv6 by checking with lsmod |grep ip

xt_multiport           12798  14 
ipt_REJECT             12541  372 
ip_set                 36629  0 
nfnetlink              14606  2 ip_set,nf_conntrack_netlink
ip_vs_sh               12688  0 
ip_vs_wrr              12697  0 
ip_vs_rr               12600  0 
ip_vs                 131881  6 ip_vs_rr,ip_vs_sh,ip_vs_wrr
ipt_MASQUERADE         12880  2 
iptable_nat            13011  1 
nf_conntrack_ipv4      14862  3 
nf_defrag_ipv4         12729  1 nf_conntrack_ipv4
nf_nat_ipv4            13263  1 iptable_nat
nf_nat                 26711  4 ipt_MASQUERADE,nf_nat_ipv4,xt_nat,iptable_nat
nf_conntrack           96187  8 ip_vs,ipt_MASQUERADE,nf_nat,nf_nat_ipv4,xt_conntrack,nf_conntrack_netlink,iptable_nat,nf_conntrack_ipv4
iptable_filter         12810  15 
ip_tables              27239  2 iptable_filter,iptable_nat

Enventually, the server will crash irregularlly and restart later, and generate a coredump file like this:

Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.tl2.3.x86_64 libgcc-4.8.5-5.tl2.x86_64 libstdc++-4.8.5-5.tl2.x86_64
(gdb) bt
#0  0x00007f42074bf1f7 in raise () from /lib64/libc.so.6
#1  0x00007f42074c08e8 in abort () from /lib64/libc.so.6
#2  0x00007f42074fef47 in __libc_message () from /lib64/libc.so.6
#3  0x00007f42075059e3 in malloc_consolidate () from /lib64/libc.so.6
#4  0x00007f42075073a5 in _int_malloc () from /lib64/libc.so.6
#5  0x00007f420750a10c in malloc () from /lib64/libc.so.6
#6  0x00007f4204a1bc5f in gpr_malloc (size=<optimized out>) at ../deps/grpc/src/core/lib/gpr/alloc.cc:57
#7  0x00007f42049bafb7 in New<grpc_chttp2_transport, grpc_channel_args const*&, grpc_endpoint*&, bool&, grpc_resource_user*&> () at ../deps/grpc/src/core/lib/gprpp/memory.h:56
#8  grpc_create_chttp2_transport (channel_args=0x459d5a0, ep=0x45a1a90, is_client=is_client@entry=false, resource_user=resource_user@entry=0x0) at ../deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc:3264
#9  0x00007f4204994b6b in on_handshake_done (arg=0x459f1b8, error=0x0) at ../deps/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc:147
#10 0x00007f42049320e1 in exec_ctx_run (error=0x0, closure=<optimized out>) at ../deps/grpc/src/core/lib/iomgr/exec_ctx.cc:40
#11 grpc_core::ExecCtx::Flush (this=this@entry=0x7ffd4b7f6bc0) at ../deps/grpc/src/core/lib/iomgr/exec_ctx.cc:158
#12 0x00007f42049a7eb0 in ~ExecCtx (this=0x7ffd4b7f6bc0, __in_chrg=<optimized out>) at ../deps/grpc/src/core/lib/iomgr/exec_ctx.h:124
#13 custom_accept_callback (socket=<optimized out>, client=0x45955f0, error=<optimized out>) at ../deps/grpc/src/core/lib/iomgr/tcp_server_custom.cc:249
#14 0x00007f4204935008 in accept_new_connection (socket=0x4480620) at ../deps/grpc/src/core/lib/iomgr/tcp_uv.cc:266
#15 uv_on_connect (server=<optimized out>, status=<optimized out>) at ../deps/grpc/src/core/lib/iomgr/tcp_uv.cc:283
#16 0x0000000000a55559 in uv__server_io (loop=0x24adfe0 <default_loop_struct>, w=0x4504a88, events=<optimized out>) at ../deps/uv/src/unix/stream.c:562
#17 0x0000000000a5a5c8 in uv__io_poll (loop=loop@entry=0x24adfe0 <default_loop_struct>, timeout=82) at ../deps/uv/src/unix/linux-core.c:375
#18 0x0000000000a4a21b in uv_run (loop=0x24adfe0 <default_loop_struct>, mode=UV_RUN_DEFAULT) at ../deps/uv/src/unix/core.c:370
#19 0x00000000008e6f45 in node::Start(v8::Isolate*, node::IsolateData*, std::vector<std::string, std::allocator<std::string> > const&, std::vector<std::string, std::allocator<std::string> > const&) ()
#20 0x00000000008e5239 in node::Start(int, char**) ()
#21 0x00007f42074abc05 in __libc_start_main () from /lib64/libc.so.6
#22 0x000000000089ed85 in _start ()

So, my question is:

1. Is there any way to start server by setting ipv4 or ipv6?

2. Is this coredump file related to ipv6 not supported?

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

1 participant