[英]grpc method call error: Failed to pick subchannel
gRpc 客戶端:Python:3.8 grpcio:1.38.1
gRpc 服務器:Dotnet 核心 5.0 LoadBalancer AKS:1.19.7
當我的 python 客戶端調用一個方法時,我遇到了以下錯誤。 任何解決問題的幫助都非常感謝。
Python代碼片段
with open('chain.pem', 'rb') as f:
trusted_certs = f.read()
credentials = channel = grpc.ssl_channel_credentials(root certificates=trusted_certs)
# 10.200.3.24 is the K8S service IP with 3 replicas
channel = grpc.secure_channel('10.200.3.24:443', credentails, options=(('grpc.enable_http_proxy', 0),))
stub = query_pb2_grpc.QueryStub(channel)
empty = google_dot_protobuf_dot_empty__pb2.Empty()
data = stub.TestMethod(empty)
錯誤
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Empty update"
debug_error_string = "{"created":"@1625180429.368158115","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3008,"referenced_errors":[{"created":"@1625178894.878505214","description":"Empty update","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":201,"grpc_status":14}]}"
>
現在已經解決了。 更新它是否可以幫助任何有類似問題的人。 首先使用以下兩個導出啟用 gRpc 跟蹤,然后運行您的代碼查看錯誤的詳細信息。
export GRPC_TRACE=all
export GRPC_VERBOSITY=DEBUG
就我而言,有以下錯誤
handshake failed: {"created":"@1582571630.967438000","description":"Peer
name 10.200.3.24 is not in peer certificate", "file":
"src/core/lib/security/security_connector/ssl/ssl_security_connector.cc",
"file_line":55}
我的服務器自簽名證書(主題:/C=US/ST=US/O=Self Signed/CN=10.100.3.250)沒有 subjectAltName 擴展名。 添加subjectAltName 擴展名(IP.1=10.100.3.250)后,東西開始正常工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.