Search code examples
apigrpcgoogle-api-python-clientgrpc-python

grpc._channel._InactiveRpcError: _InactiveRpcError of RPC that terminated with: status = StatusCode.INTERNAL


This is a gRPC service & client python program. After running the client script it throwing this error. I am pretty new to using APIs/ gRPC in particular. It would be great if I get to know what might be the problem. Installed gRPC library & few supporting libraries too.

Even though the server is running correctly, the communication through gRPC is terminating with the INTERNAL error status code. Running it on localhost.

return _end_unary_response_blocking(state, call, False, None)
  File "/home/mark/anaconda3/envs/custom-model-server/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INTERNAL
        details = "indices[0,350] = 1650751580 is not in [0, 30522)
         [[{{node tf_bert_for_sequence_classification/bert/embeddings/Gather}}]]"
        debug_error_string = "{"created":"@1629922773.170809502","description":"Error received from peer ipv4:127.0.0.1:8001","file":"src/core/lib/surface/call.cc","file_line":1066,"grpc_message":"indices[0,350] = 1650751580 is not in [0, 30522)\n\t [[{{node tf_bert_for_sequence_classification/bert/embeddings/Gather}}]]","grpc_status":13}"
'''

Solution

  • The solution for this was to check the byte array that was being passed to the function and make sure the length we were taking was of the array itself not in bytes. So we were able to do:

    dimensions = len(byte_array)//4