本例环境如下: python版本: 3.7.1 etcd3版本: 0.12.0 报错信息: state = <grpc._channel._RPCState object at 0x7f51082a8b70> call = <grpc._cython.cygrpc.SegregatedCall object at 0x7f51080edc08> with_call = False, deadline = None def _end_unary_response_blocking(state, call, with_call, deadline): if state.code is grpc.StatusCode.OK: if with_call: rendezvous = _MultiThreadedRendezvous(state, call, None, deadline) return state.response, rendezvous else: return state.response else: > raise _InactiveRpcError(state) E grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: E status = StatusCode.UNAUTHENTICATED E details = "Established channel does not have a sufficient security level to transfer call credential." E debug_error_string = "{"created":"@1653981702.899194914","description":"Error received from peer 127.0.0.1:2379","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Established channel does not have a sufficient security level to transfer call credential.","grpc_status":16}" E > /root/.pyenv/versions/3.7.1/lib/python3.7/site-packages/grpc/_channel.py:849: _InactiveRpcError
本例连接异常是因为grpcio版本太高,grpcio==1.45.0
降级后解决
pip uninstall grpcio
pip install grpcio==1.19.0