How to fix client-side error: "Endpoint read failed"?

779 views
Skip to first unread message

rkabh...@gmail.com

unread,
Jan 24, 2018, 7:15:21 PM1/24/18
to grpc.io
I am seeing this error "Endpoint read failed" on the client-side with the below code following this example (https://github.com/grpc/grpc/blob/v1.4.5/examples/cpp/route_guide/route_guide_client.cc). Using grpc v1.4.5.


Any idea how I  can fix this?

    grpc::ClientContext context;
    grpc::Status status;
    gnmi::SubscribeResponse response;

    std::unique_ptr<grpc::ClientReaderWriter<gnmi::SubscribeRequest, gnmi::SubscribeResponse>> c = stub_->Subscribe(&context);
    std::shared_ptr<grpc::ClientReaderWriter<gnmi::SubscribeRequest, gnmi::SubscribeResponse>> cs (move(c));

    std::thread writer([cs, payload, operation]() {
       gnmi::SubscribeRequest r;
       gnmi::SubscriptionList* sl = new gnmi::SubscriptionList;

       populate_subscribe_request(r, payload, operation, *sl);

       cs->Write(r);
       cs->WritesDone();
    });

    while (cs->Read(&response))
    {
      debug_log("Getting subscription data");
    }

    writer.join();
    status = cs->Finish();

    if (!status.ok())
    {
      throw(error{status.error_message()});  // Seeing the error here
    }


rkabh...@gmail.com

unread,
Jan 25, 2018, 1:17:15 PM1/25/18
to grpc.io
This part of the error log seems most relevant. It states that the socket closed and the connection is no longer valid. I don't understand why this is the case as the grpc::ClientReaderWriter object is still active after the Read/Write requests are done?

D0124 16:03:06.760391000 140735208460288 connectivity_state.c:185]     SET: 0x7fe460700650 (null): READY --> SHUTDOWN [selected_changed] error=0x7fe460624330 {"created":"@1516838586.760240000","description":"Endpoint read failed","file":"src/core/ext/transport/chttp2/transport/chttp2_transport.c","file_line":2221,"grpc_status":14,"occurred_during_write":0,"referenced_errors":[{"created":"@1516838586.760238000","description":"Secure read failed","file":"src/core/lib/security/transport/secure_endpoint.c","file_line":166,"referenced_errors":[{"created":"@1516838586.760236000","description":"Socket closed","fd":9,"file":"src/core/lib/iomgr/tcp_posix.c","file_line":293,"target_address":"ipv4:10.30.110.86:57400"}]}]}
 
D0124 16:03:06.760486000 140735208460288 connectivity_state.c:185]     SET: 0x7fe460418220 client_channel: READY --> TRANSIENT_FAILURE [lb_changed] error=0x7fe460624330 {"created":"@1516838586.760240000","description":"Endpoint read failed","file":"src/core/ext/transport/chttp2/transport/chttp2_transport.c","file_line":2221,"grpc_status":14,"occurred_during_write":0,"referenced_errors":[{"created":"@1516838586.760238000","description":"Secure read failed","file":"src/core/lib/security/transport/secure_endpoint.c","file_line":166,"referenced_errors":[{"created":"@1516838586.760236000","description":"Socket closed","fd":9,"file":"src/core/lib/iomgr/tcp_posix.c","file_line":293,"target_address":"ipv4:10.30.110.86:57400"}]}]}

Any idea what could be wrong with the code to cause this error?

Thanks,

Abhishek Keshav

unread,
Jan 29, 2018, 11:00:17 AM1/29/18
to grpc.io
Hi,

Any ideas about this error? Any pointers would be appreciated.

Thanks

--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/vX7JN3wBGMM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d313cedc-bdc0-479e-95b9-9390a167e15b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

g13...@gmail.com

unread,
Apr 19, 2019, 12:51:48 PM4/19/19
to grpc.io
I have the same issue using php, on my machine I use in docker without a problem, but on a remote server, I encounter the same problem with exact grpc and protobuf version.

Did anyone manage to solve this problem?
Reply all
Reply to author
Forward
0 new messages