
AttributeError: ‘ThriftInfinityClient’ object has no attribute ‘_is_connected’
快速结论:该报错通常出现在 RAGFlow Docker 部署环境中,由于 Infinity 文档引擎节点无法连接(连接超时),导致客户端对象在销毁时因缺少 _is_connected 属性而抛出 AttributeError。优先排查 Infinity 容器是否正常运行、版本是否匹配以及网络连通性。
问题场景
用户通过 Docker 部署 RAGFlow (v0.17.1 slim) 后启动服务,发现日志中 Elasticsearch 和 Infinity 均连接失败,最终无法登录 Web 页面。报错集中在 Infinity 客户端尝试连接远程 Thrift 端口 (23817) 时出现 TimeoutError,随后在对象析构函数 __del__ 中触发 AttributeError: 'ThriftInfinityClient' object has no attribute '_is_connected'。
报错原文
AttributeError: 'ThriftInfinityClient' object has no attribute '_is_connected'
Exception ignored in: <function ThriftInfinityClient.__del__ at 0x7f867cd58af0>
...
AttributeError: 'RemoteThriftInfinityConnection' object has no attribute '_is_connected'
Exception ignored in: <function RemoteThriftInfinityConnection.__del__ at 0x7f8669f0aa70>
...
TimeoutError: [Errno 110] Connection timed out
Could not connect to any of [('44.227.76.166', 23817), ('44.227.65.245', 23817)]
原因分析
可能原因包括:
- Infinity 容器未正常启动或版本不兼容:用户反馈显示,使用 Infinity v0.5.2 时日志中出现
Index: 29 isn't supported, you are using a deprecated version of Python SDK错误,说明 RAGFlow 客户端版本与 Infinity 服务端版本不匹配。 - 网络连接问题:日志中出现连接远程 IP (44.227.76.166, 44.227.65.245) 超时,可能是容器网络配置错误或 hostname 解析问题。
- 对象初始化不完整:由于连接在构造函数阶段失败,
_is_connected属性未被赋值,导致析构时报错。这是 Python SDK 的异常处理缺陷。
环境排查
- 确认 RAGFlow 版本:用户使用的 v0.17.1 slim
- 确认 Infinity 版本:用户最初遇到 v0.5.2,切换至 0.6.0-dev3 后问题消除
- 检查 Docker 容器状态:
docker ps | grep infinity - 检查容器日志:
docker logs ragflow-infinity - 确认容器间网络互通:
docker exec ragflow-server ping infinity
解决步骤
- 升级 Infinity 镜像版本:根据评论反馈,将 Infinity 镜像切换至
0.6.0-dev3即可解决版本兼容性问题。可优先尝试。 - 检查容器日志:运行
docker logs ragflow-infinity查看是否有Index: 29 isn't supported或其他版本提示。 - 确认网络配置:确保
docker-compose.yml中 Infinity 服务名为infinity,端口映射正常(23817)。检查是否误用了外部 IP 而非容器内部 hostname。 - 重新部署服务:如果版本升级后问题仍然存在,建议更换机器或重新拉取镜像并清理旧容器/数据卷后再次部署。
- 手动测试连接:进入 ragflow-server 容器内,执行
python -c "from thrift.transport import TSocket; s=TSocket.TSocket('infinity',23817); s.open()"测试连通性。
验证方法
确认 RAGFlow Web 页面可以正常登录,且日志中不再出现 AttributeError: 'ThriftInfinityClient' object has no attribute '_is_connected' 和 Could not connect to any of 错误。同时 Infinity 容器日志应无版本不兼容警告。



