Hello

I am trying to call a grpc service from python. 

I have generated python code using protoc 3.4.1. And I have tried with grpc 
1.6.6 and grpc 1.6.1

I have also generated java code, and can successfully call the same service 
method from java.

When I try to run the python code I get the following error:

>
>   File "my_client.py", line 107, in <module>
>     run()
>   File "my_client.py", line 87, in run
>     response = stub.ChartRequest(request)
>   File 
> "/home/anton/git/pi/rm/venv/lib/python3.6/site-packages/grpc/_channel.py", 
> line 492, in __call__
>     return _end_unary_response_blocking(state, call, False, deadline)
>   File 
> "/home/anton/git/pi/rm/venv/lib/python3.6/site-packages/grpc/_channel.py", 
> line 440, in _end_unary_response_blocking
>     raise _Rendezvous(state, None, None, deadline)
> grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with 
> (StatusCode.INTERNAL, Did not read entire message)>


My python code is:

import grpc
# import sys
import time
import datetime
import os

#os.environ["GRPC_TRACE"] = "all"
os.environ["GRPC_VERBOSITY"] = "DEBUG"


host = "10.5.0.5"
port = 50051




def run():
    channel = grpc.insecure_channel(host + ':' + str(port))
    # cridentials?
    stub = ChartService_pb2_grpc.ChartServiceStub(channel)


    crrm = ChartRequestMessage_pb2
    request = crrm.Info__pb2.ChartInfo(symbol='HELLO', period=Period_pb2.
PERIOD_M1, timesign=1)
    response = stub.ChartRequest(request)


    print("printing results")
    for ri in response.rate_info:
        print(ri)


if __name__ == '__main__':
    run()

 


Does anyone know what the problem might be?

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
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/3847441c-ef20-4d74-9a30-3362138b1bc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to