cisco-gnmi-python icon indicating copy to clipboard operation
cisco-gnmi-python copied to clipboard

Recieving EOF grpc message with "-no_stop" SubscribeRequest

Open mike-albano opened this issue 4 years ago • 3 comments

When utilizing the -no_stop option to continually dump, the RPC is terminating with EOF.

python3 subscribe_dump.py -xpath '/access-points/access-point[hostname="albano-house.example.net"]/radios/radio[id="0"]/state/rx-noise-channel-utilization/' '192.168.0.31:8080' -os None
Username: admin
Password:
INFO:root:Connecting to 192.168.0.31:8080 as None ...
WARNING:root:Overriding SSL option from certificate could increase MITM susceptibility!
INFO:root:Subscribing to /access-points/access-point[hostname="albano-house.example.net"]/radios/radio[id="0"]/state/rx-noise-channel-utilization/ ...
INFO:root:{'update': {'timestamp': '1587091884807946240', 'update': [{'path': {'elem': [{'name': 'access-points'}, {'name': 'access-point', 'key': {'hostname': 'albano-house.example.net'}}, {'name': 'radios'}, {'name': 'radio', 'key': {'id': '0'}}, {'name': 'state'}, {'name': 'rx-noise-channel-utilization'}]}, 'val': {'uintVal': '0'}}]}}
ERROR:root:Stopping due to exception!
Traceback (most recent call last):
  File "subscribe_dump.py", line 56, in main
    for message in client.subscribe_xpaths(**sub_args):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 364, in __next__
    return self._next()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 347, in _next
    raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "EOF"
	debug_error_string = "{"created":"@1587091885.760523000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1036,"grpc_message":"EOF","grpc_status":2}"
>
INFO:root:Writing to gnmi_sub.json ...

And gnmi_sub.json does contain that first response as in the output above.

This particular Target is an Arista Access Point.

mike-albano avatar Apr 17 '20 18:04 mike-albano

This looks like a server error - an underlying gRPC error versus an explicit gNMI error. I don't have an Arista AP to test against, and don't have advice beyond "try updating software" unfortunately. Feel free to bring any support in here if it's a client issue. Also very open to any improvements around how errors are handled.

I don't see any mention of EOF in the gNMI spec, so I don't think this is intended behavior, and looks like a gRPC "stream is broken" kind of issue.

Quickly testing against IOS XR, proceeds past sync_response as expected with more data on the next sample:

python subscribe_dump.py 10.200.99.61:57500 -no_stop
...
]}, 'val': {'uintVal': '0'}}, {'path': {'elem': [{'name': 'out-discards'}]}, 'val': {'uintVal': '0'}}]}}
INFO:root:{'syncResponse': True}
INFO:root:{'update': {'timestamp': '1587150931610000000'

remingtonc avatar Apr 17 '20 19:04 remingtonc

I'll give it a shot with some of the other vendor Target implementations we have as well and report back.

Happy to provide you direct access if you'd also like to take a look, or drop time to discuss.

mike-albano avatar Apr 17 '20 23:04 mike-albano

@mike-albano Drop an email to remcampb at cisco.com, let's talk and look around.

remingtonc avatar Apr 20 '20 00:04 remingtonc