Fetching the document database often times-out
还没有人认领这个 Issue。
评估
调研方向
从 devdocs2zim/client.py 中的 _get_text()、read_doc_file() 和 get_db() 开始,然后从 generator.py 追踪它们的使用情况。针对 documents.devdocs.io 重现已记录的读取超时,并检查连续任务是如何处理的。完成标准是:临时的文档数据库获取超时不再导致生成意外失败;通过相关测试或重复运行生成进行验证。
由索引模型根据 Issue 内容生成。
描述
See e.g. https://farm.openzim.org/pipeline/761e418d-483b-4909-b6f7-a92c9fdccca3/debug, but we have ten to twenty occurrences every quarter.
Restarting the recipe is enough to solve the problem, sometimes twice.
[devdocs2zim::2026-06-02 15:16:43,323] INFO: Fetching the index...
[devdocs2zim::2026-06-02 15:16:43,825] INFO: Fetching the document database...
[devdocs2zim::2026-06-02 15:16:58,864] ERROR:HTTPSConnectionPool(host='documents.devdocs.io', port=443): Read timed out. (read timeout=15)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 534, in _make_request
response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 571, in getresponse
httplib_response = super().getresponse()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/http/client.py", line 1430, in getresponse
response.begin()
File "/usr/local/lib/python3.12/http/client.py", line 331, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/http/client.py", line 292, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/socket.py", line 720, in readinto
return self._sock.recv_into(b)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/ssl.py", line 1251, in recv_into
return self.read(nbytes, buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/ssl.py", line 1103, in read
return self._sslobj.read(len, buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: The read operation timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 841, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 490, in increment
raise reraise(type(error), error, _stacktrace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/util/util.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 787, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 536, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 367, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='documents.devdocs.io', port=443): Read timed out. (read timeout=15)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/devdocs2zim/entrypoint.py", line 104, in main
).run()
^^^^^
File "/usr/local/lib/python3.12/site-packages/devdocs2zim/generator.py", line 454, in run
self.generate_zim(
File "/usr/local/lib/python3.12/site-packages/devdocs2zim/generator.py", line 506, in generate_zim
db = self.devdocs_client.get_db(doc_metadata.slug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/devdocs2zim/client.py", line 329, in get_db
file_contents = self.read_doc_file(doc_slug, "db.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/devdocs2zim/client.py", line 308, in read_doc_file
return self._get_text(f"{self.documents_url}/{doc_slug}/{file_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/devdocs2zim/client.py", line 264, in _get_text
resp = requests.get(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 713, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='documents.devdocs.io', port=443): Read timed out. (read timeout=15)
[devdocs2zim::2026-06-02 15:16:58,890] ERROR:Generation failed with the following error: HTTPSConnectionPool(host='documents.devdocs.io', port=443): Read timed out. (read timeout=15)
Looks like it is very related to the same worker starting two tasks in a row.
- 主要语言
- Python
- 星标
- 9
- 派生
- 3
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openzim/devdocs 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 45/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
awslabs/visual-asset-management-system#414 ·
维护者通常 1 天内回复
-
bug v1 v2
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/python-sdk#3670 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
aicell-lab/bioengine#232 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
modelscope/evalscope#1836 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100