Connection error in using P4runtime

I get an error when streaming the table through P4runtime.

Traceback (most recent call last):
  File "/home/p4/tutorials/exercises/PubSub/", line 107, in <module>
    main(p4info, bmv2_json, sw, sw_address, id, dst_ip_addr, prefix,es_port,table)
  File "/home/p4/tutorials/exercises/PubSub/", line 83, in main
  File "/home/p4/tutorials/exercises/PubSub/", line 38, in writeAggregatedRules
  File "/home/p4/tutorials/exercises/PubSub/../../utils/p4runtime_lib/", line 101, in WriteTableEntry
  File "/usr/local/lib/python3.8/dist-packages/grpc/", line 207, in __call__
    response, ignored_call = self._with_call(
  File "/usr/local/lib/python3.8/dist-packages/grpc/", line 240, in _with_call
    call = self._interceptor.intercept_unary_unary(
  File "/home/p4/tutorials/exercises/PubSub/../../utils/p4runtime_lib/", line 230, in intercept_unary_unary
    return continuation(client_call_details, request)
  File "/usr/local/lib/python3.8/dist-packages/grpc/", line 228, in continuation
    response, call = self._thunk(new_method).with_call(
  File "/usr/local/lib/python3.8/dist-packages/grpc/", line 557, in with_call
    return _end_unary_response_blocking(state, call, True, None)
  File "/usr/local/lib/python3.8/dist-packages/grpc/", line 466, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = ""
        debug_error_string = "{"created":"@1689669102.561950578","description":"Error received from peer","file":"src/core/lib/surface/","file_line":1036,"grpc_message":"","grpc_status":2}"

The error seems to be random, sometimes I get an error the first time I call the relevant py file to send down that flow table, sometimes the second time.
I didn’t find a solution for this in my online research, its reported as UNKOWN.
The format of the parameter I am sending down is correct (because it went down the first time)
What should I do to solve the problem?