grpc 报错 debug_error_string = "{"created":"@1563958480.003440000","description":"Error received fr... - Go语言中文社区

grpc 报错 debug_error_string = "{"created":"@1563958480.003440000","description":"Error received fr...


1.问题描述

在学习grpc官方文档的时候,发生了一个问题,就是client端迟迟没有反应并且最终会报错,错误如下:

Traceback (most recent call last):
  File "greeter_client.py", line 37, in <module>
    run()
  File "greeter_client.py", line 31, in run
    response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
  File "/Users/wengzhenxi/Library/Python/3.6/lib/python/site-packages/grpc/_channel.py", line 565, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Users/wengzhenxi/Library/Python/3.6/lib/python/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
    status = StatusCode.UNAVAILABLE
    details = "Socket closed"
    debug_error_string = "{"created":"@1563958480.003440000","description":"Error received from peer ipv4:127.0.0.1:1087","file":"src/core/lib/surface/call.cc","file_line":1052,"grpc_message":"Socket closed","grpc_status":14}"
>

2.错误分析

这是一个中国程序员可能会出现的问题。
首先在google上没有找到答案。(因为外国同志不会遇到)
后来认真研究了一下错误,发现这一条:

"description":"Error received from peer ipv4:127.0.0.1:1087"

表示没有received 到什么东西从1087端口,但是我client端明明是通过50051去请求的。看着1087越看越熟悉。。。我为了看外面的世界,设置了全局代理......去掉代理,解决。
全局代理的坑

3.结束

希望对大家有用。

版权声明:本文来源简书,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://www.jianshu.com/p/9763d306ccbf
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-02-02 14:54:40
  • 阅读 ( 3592 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢