解决raise _InactiveRpcError(state)grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that ...

文章讲述了在使用DPF-Core时遇到的gRPC错误,特别是_InactiveRpcError,通过关闭代理、调整grpc连接设置和使用`connect_to_server`函数连接服务器来解决问题。然而,连接服务器导致CPU占用过高,最终导致程序崩溃。

在使用DPF-Core时,使用以下代码报错。

from ansys.dpf.core import Model
from ansys.dpf.core import examples

path1 = examples.find_simple_bar()
path2 = examples.download_transient_result()

model = Model(path1)
print(model)

报错:

 raise _InactiveRpcError(state)  # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNIMPLEMENTED
	details = ""
	debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"", grpc_status:12, created_time:"2023-12-21T09:35:09.1882508+00:00"}"
>

解决:

搜了搜很多回答说以下方法可以:

 关闭代理。

unset http_proxy; unset https_proxy; python server.py &
unset http_proxy; unset https_proxy; python client.py

我还发现额外的 options 可以传递给 grpc.insecure_channel 。</

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值