0

I have a grpc client and server running in 2 different servers. with this setup, when I run client, below error is coming.

Connect failed: {"created":"@1565697395.391945051","description":"Failed to connect to remote host: FD 
Shutdown","file":"src/core/lib/iomgr/lockfree_event.cc","file_line":194,"os_error":"Timeout occurred","referenced_errors":
[{"created":"@1565697395.391908468","description":"connect() timed out","file":"src/core/lib/iomgr/tcp_client_posix.cc","file_line":119}],"target_address":"ipv4:192.168.1.14:50051"}

if client and server are on the same server, it works fine.

client code(python)
---------------------

channel = grpc.insecure_channel('192.168.1.14:50051')
stub = mmeGrpc_pb2_grpc.MmeGrpcCliStub(channel)

server code(cpp)(192.168.1.14)
----------------
  std::string server_address("0.0.0.0:50051");
  MmeGrpcCliServiceImpl service;

  ServerBuilder builder;

  builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());

  builder.RegisterService(&service);

  std::unique_ptr<Server> server(builder.BuildAndStart());

  server->Wait();
Piszu
  • 443
  • 1
  • 8
  • 24
  • Yes, this should work. The "connect() timed out" error suggests that TCP connectivity to your remote server address isn't working (and that would be the problem if so). – apolcyn Aug 14 '19 at 18:16
  • Do you perhaps have a firewall blocking traffic to the destination IP/port? – apolcyn Aug 14 '19 at 18:16
  • A strategy for debugging this may be to see if you can first get TCP connectivity to work. For example, running something like python -c "import socket; socket.create_connection(['192.168.1.14', 50051])", from the same machine as the grpc client which originally saw that error should finish quickly and exit 0. Suggest making sure that that works as a first debugging step. – apolcyn Aug 14 '19 at 18:20
  • @apolcyn : you are right..TCP connectivity was not there for the port 50051 to the remote server. After adding the port to IPTables, it worked.Thanks a lot. – Angel Peehuu Aug 16 '19 at 03:54

0 Answers0