tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

GRPC error when using clone_session_entries

Open chenIshi opened this issue 5 years ago • 1 comments

I was using master branch and recently try out the clone_session_entries, however, at first I tried it with p4runtime(by using buildCloneSessionEntry at runtime) but it return with a GRPC ERROR (UNKNOWN) seems not helpful.

So latter I try it with s1-runtime.json to config it in compile time, some questions popped up then:

I was previously success with using the multicast exercise, I thought the structure of clone is similar to multicast with previous commit modification( commit #4914893) , this should be somehow success too.

However, it failed with these error

sudo python ../../utils/run_exercise.py -t topology.json -j build/forwarder.json -b simple_switch_grpc
Reading topology file.
Building mininet topology.
Configuring switch s1 using P4Runtime with file s1-runtime.json
 - Using P4Info file build/forwarder.p4.p4info.txt...
 - Connecting to P4Runtime server on 127.0.0.1:50051 (bmv2)...
 - Setting pipeline config (build/forwarder.json)...
 - Inserting 1 clone entries...
 - Clone Session 5 => (2, 3) (41B)
Traceback (most recent call last):
  File "../../utils/run_exercise.py", line 383, in <module>
    exercise.run_exercise()
  File "../../utils/run_exercise.py", line 199, in run_exercise
    self.program_switches()
  File "../../utils/run_exercise.py", line 304, in program_switches
    self.program_switch_p4runtime(sw_name, sw_dict)
  File "../../utils/run_exercise.py", line 276, in program_switch_p4runtime
    proto_dump_fpath=outfile)
  File "/home/p4/git/tutorials/utils/p4runtime_lib/simple_controller.py", line 143, in program_switch
    insertCloneGroupEntry(sw, entry, p4info_helper)
  File "/home/p4/git/tutorials/utils/p4runtime_lib/simple_controller.py", line 232, in insertCloneGroupEntry
    sw.WritePREEntry(clone_entry)
  File "/home/p4/git/tutorials/utils/p4runtime_lib/switch.py", line 146, in WritePREEntry
    self.client_stub.Write(request)
  File "/usr/local/lib/python2.7/dist-packages/grpc/_interceptor.py", line 221, in __call__
    compression=compression)
  File "/usr/local/lib/python2.7/dist-packages/grpc/_interceptor.py", line 257, in _with_call
    return call.result(), call
  File "/usr/local/lib/python2.7/dist-packages/grpc/_channel.py", line 333, in result
    raise self
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = ""
	debug_error_string = "{"created":"@1602228154.324073729","description":"Error received from peer ipv4:127.0.0.1:50051","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"","grpc_status":2}"
>
../../utils/Makefile:35: recipe for target 'run' failed
make: *** [run] Error 1

By the way, I was using the vagrant environment build in /vm

chenIshi avatar Oct 09 '20 07:10 chenIshi

You want to make sure you use https://github.com/p4lang/tutorials/blob/master/utils/p4runtime_lib/error_utils.py to interpret errors returned by the P4Runtime server for Write RPCs. This is because of the very specific error-reporting mechanism of P4Runtime.

antoninbas avatar Oct 09 '20 17:10 antoninbas