Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

error when client connect

未关闭
#2,220 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@dudanogueira 已经在做这个了。

开始于 2026年10月22日。

  • #2222 来自 @dudanogueira —— 未关闭
  • #2223 来自 @dudanogueira —— 未关闭

评估

难度
4/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend, databases

调研方向

Start by reading the connection path in /app/clientmanager/weaviate.py at line 98 and its caller in /app/api/routes.py at line 154, then check how the Weaviate client selects its HTTP transport and timeout type. Reproduce with the reported Weaviate, LangChain, and OpenAI setup; done when client.connect() succeeds without the Timeout type error.

由索引模型根据 Issue 内容生成。

描述

Traceback (most recent call last):
File "/app/api/routes.py", line 154, in generate_response
await client.connect()
File "/app/clientmanager/weaviate.py", line 98, in connect
await self.client.connect()
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 92, in _execute
return cast(T, exception_callback(e))
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 38, in raise_exception
raise e
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 86, in _execute
res = await call
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/v4.py", line 1112, in connect
meta = await self.get_meta(False)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 92, in _execute
return cast(T, exception_callback(e))
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 38, in raise_exception
raise e
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 86, in _execute
res = await call
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 92, in _execute
return cast(T, exception_callback(e))
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/v4.py", line 701, in exc
self.__handle_exceptions(e, error_msg)
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/v4.py", line 657, in __handle_exceptions
raise e
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/executor.py", line 86, in _execute
res = await call
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx2/_client.py", line 1818, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx2/_client.py", line 1846, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx2/_client.py", line 1881, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx2/_client.py", line 1915, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx2/_transports/default.py", line 388, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore2/_async/connection_pool.py", line 242, in handle_async_request
raise exc from None
File "/usr/local/lib/python3.11/site-packages/httpcore2/_async/connection_pool.py", line 224, in handle_async_request
response = await connection.handle_async_request(pool_request.request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore2/_async/connection.py", line 94, in handle_async_request
raise exc
File "/usr/local/lib/python3.11/site-packages/httpcore2/_async/connection.py", line 74, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore2/_async/connection.py", line 117, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore2/_backends/auto.py", line 31, in connect_tcp
return await self._backend.connect_tcp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore2/_backends/anyio.py", line 117, in connect_tcp
with anyio.fail_after(timeout):
File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_core/_tasks.py", line 177, in fail_after
deadline = (current_time() + delay) if delay is not None else math.inf
~~~~~~~~~~~~~~~^~~~~~~
TypeError: unsupported operand type(s) for +: 'float' and 'Timeout'

I have both weaviate client 4.24.0 in my app as well as langchain with openai

it seems like weaviate client uses httpx while langchain and openai have httpx2 and somehow the weaviate client is attempting to make requests with httpx2 which doesn't like the Timeout object

I can't seem to find a workaround and i know that the weaviate client libraray doesn't import httpx2

主要语言
Python
星标
228
派生
167
平均合并
2 天 22 小时
30 天内合并 PR
20

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

weaviate/weaviate-python-client 的其他 Issue

查看 weaviate/weaviate-python-client 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。