连接到运行在Go with python中的grpc服务时出现的问题

连接到运行在Go with python中的grpc服务时出现的问题,python,grpc,Python,Grpc,我在使用python库连接到运行在GO中的grpc服务时遇到问题 我正在使用图书馆 grpcio==1.10.1 这是我的密码 import grpc from hello_world import hello_world_pb2_grpc from hello_world import hello_world_pb2 channel = grpc.insecure_channel('localhost:5000') stub =hello_world_pb2_grpc.CallStub(ch

我在使用python库连接到运行在GO中的grpc服务时遇到问题

我正在使用图书馆

grpcio==1.10.1
这是我的密码

import grpc
from hello_world import hello_world_pb2_grpc
from hello_world import hello_world_pb2
channel = grpc.insecure_channel('localhost:5000')
stub =hello_world_pb2_grpc.CallStub(channel)
stub.Call()
在设置调试模式之后,当我这样做时,我得到了以下错误

channel = grpc.insecure_channel('localhost:5000')


>>> E0614 21:11:00.273830440   14198 channel_connectivity.cc:126] watch_completion_error: "Cancelled"
E0614 21:11:00.273870160   14198 completion_queue.cc:634]    Operation failed: tag=0x7fbaab82b320, error={"created":"@1529010660.273816994","description":"Timed out waiting for connection state change","file":"src/core/ext/filters/client_channel/channel_connectivity.cc","file_line":133}
E0614 21:11:00.474877364   14195 channel_connectivity.cc:126] watch_completion_error: "Cancelled"
E0614 21:11:00.474967852   14195 completion_queue.cc:634]    Operation failed: tag=0x7fbaab82b358, error={"created":"@1529010660.474849365","description":"Timed out waiting for connection state change","file":"src/core/ext/filters/client_channel/channel_connectivity.cc","file_line":133}
E0614 21:11:00.675819616   14198 channel_connectivity.cc:126] watch_completion_error: "Cancelled"
E0614 21:11:00.675860536   14198 completion_queue.cc:634]    Operation failed: tag=0x7fbaab82b358, error={"created":"@1529010660.675806653","description":"Timed out waiting for connection state change","file":"src/core/ext/filters/client_channel/channel_connectivity.cc","file_line":133}

E0614 21:11:00.876819325   14195 channel_connectivity.cc:126] watch_completion_error: "Cancelled"
E0614 21:11:00.876855700   14195 completion_queue.cc:634]    Operation failed: tag=0x7fbaab82b320, error={"created":"@1529010660.876806994","description":"Timed out waiting for connection state change","file":"src/core/ext/filters/client_channel/channel_connectivity.cc","file_line":133}
这就是错误的样子

E0614 19:43:39.385612320    8409 lockfree_event.cc:209]      LockfreeEvent::SetReady: 0x7f7b18001a28 curr=0x7f7b14001120
E0614 19:43:39.385634661    8409 lockfree_event.cc:209]      LockfreeEvent::SetReady: 0x7f7b18001a30 curr=0x2
E0614 19:43:39.385664271    8409 lockfree_event.cc:94]       LockfreeEvent::NotifyOn: 0x7f7b18001a28 curr=(nil) closure=0x7f7b14001120
E0614 19:43:39.390243947    8409 lockfree_event.cc:209]      LockfreeEvent::SetReady: 0x7f7b18001a28 curr=0x7f7b14001120
E0614 19:43:39.390261213    8409 lockfree_event.cc:209]      LockfreeEvent::SetReady: 0x7f7b18001a30 curr=0x2
E0614 19:43:39.390363730    8409 lockfree_event.cc:160]      LockfreeEvent::SetShutdown: 0x7f7b18001a28 curr=(nil) err={"created":"@1529005419.390300526","description":"Delayed close due to in-progress write","file":"src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":589,"referenced_errors":[{"created":"@1529005419.390289956","description":"Endpoint read failed","file":"src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":2446,"occurred_during_write":0,"referenced_errors":[{"created":"@1529005419.390275545","description":"Socket closed","fd":7,"file":"src/core/lib/iomgr/tcp_posix.cc","file_line":423,"grpc_status":14,"target_address":"ipv4:127.0.0.1:8081"}]}]}
E0614 19:43:39.390380912    8409 lockfree_event.cc:160]      LockfreeEvent::SetShutdown: 0x7f7b18001a30 curr=0x2 err={"created":"@1529005419.390300526","description":"Delayed close due to in-progress write","file":"src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":589,"referenced_errors":[{"created":"@1529005419.390289956","description":"Endpoint read failed","file":"src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":2446,"occurred_during_write":0,"referenced_errors":[{"created":"@1529005419.390275545","description":"Socket closed","fd":7,"file":"src/core/lib/iomgr/tcp_posix.cc","file_line":423,"grpc_status":14,"target_address":"ipv4:127.0.0.1:8081"}]}]}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/me/lib/python3.6/site-packages/grpc/_channel.py", line 500, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/home/me/lib/python3.6/site-packages/grpc/_channel.py", line 434, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, Socket closed)>
E0614 19:43:39.385612320 8409无锁事件。cc:209]无锁事件::SetReady:0x7B18001A28 curr=0x7f7b14001120
E0614 19:43:39.385634661 8409无锁事件。cc:209]无锁事件::SetReady:0x7B18001A30 curr=0x2
E0614 19:43:39.385664271 8409无锁事件。cc:94]无锁事件::通知:0x7f7b18001a28 curr=(nil)closure=0x7f7b14001120
E0614 19:43:39.390243947 8409无锁事件。cc:209]无锁事件::设置就绪:0x7f7b18001a28 curr=0x7f7b14001120
E0614 19:43:39.390261213 8409无锁事件。cc:209]无锁事件::SetReady:0x7B18001A30 curr=0x2
E0614 19:43:39.390363730 8409无锁事件。cc:160]无锁事件::设置关机:0x7f7b18001a28 curr=(nil)err={“已创建”:“@1529005419.390300526”,“说明”:“由于进行中写入而延迟关闭”,“文件”:“src/core/ext/transport/chttp2/transport/chttp2_transport.cc”,“文件行”:589,“引用的_错误”[{“已创建”:@1529005419.390289956”“说明”:“端点读取失败”,“文件”:“src/core/ext/transport/chttp2/transport/chttp2_transport.cc”,“文件行”:2446,“写入期间发生”:0,“引用的_错误”:[{“创建”:“@1529005419.390275545”,“说明”:“套接字关闭”,“fd”:7,“文件”:“src/core/lib/iomgr/tcp_posix.cc”,“文件行”:423,“grpc_状态”:14,“目标地址”:“ipv4:127.0.0.1:8081”}]}]}
E0614 19:43:39.390380912 8409无锁事件。cc:160]无锁事件::设置关机:0x7f7b18001a30 curr=0x2 err={“已创建”:“@1529005419.390300526”,“说明”:“由于进行中写入而延迟关闭”,“文件”:“src/core/ext/transport/chttp2/transport/chttp2_transport.cc”,“文件行”:589,“引用的错误”:[{“已创建”:“@1529005419.390289956”描述“:”端点读取失败“,”文件“:”src/core/ext/transport/chttp2/transport/chttp2_transport.cc“,”文件行“:”2446,“在_写入期间发生“:”0,“引用的_错误“:[{”已创建“@1529005419.390275545”,“描述“:”套接字已关闭“,”fd“:”7,“文件“:”src/core/lib/iomgr/tcp_posix.cc“,”文件行“:423,“grpc_状态”:14,“目标地址”:”ipv4:127.0.0.1:8081“}]}]}
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/home/me/lib/python3.6/site packages/grpc/_channel.py”,第500行,在调用中__
返回\u结束\u一元\u响应\u阻塞(状态、调用、错误、无)
文件“/home/me/lib/python3.6/site packages/grpc/_channel.py”,第434行,一元响应
提升集合点(状态,无,无,截止日期)
grpc._通道_会合点:
它显示它无法连接到给定端口上的给定服务。但是,其他服务可以连接到以其他语言编写的给定端口

另外,如果我使用telnet
localhost:5000
,它就能够连接


有什么问题吗?

您是否配置了代理?如果有,请查看取消设置http\U代理和https\U代理是否有效果:取消设置http\U代理;取消设置https\U代理;python hello\u world.py。@msmolens。我没有代理set@rajansthapit您是否尝试升级到最新的
grpcio
软件包?