mozilla / mozilla/bugbug

ConnectTimeout in _get_file_from_patch()

Open
#5,905 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code-review
Dominant language
Python
Stars
570
Forks
351
Avg merge
2d 13h
Merged PRs (30d)
65

Description

Exception: ConnectTimeout('')Traceback (most recent call last):
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions yield
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 394, in handle_async_request resp = await self._pool.handle_async_request(req)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request raise exc from None
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request response = await connection.handle_async_request(
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request raise exc
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 78, in handle_async_request stream = await self._connect(request)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 124, in _connect stream = await self._network_backend.connect_tcp(**kwargs)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_backends/auto.py", line 31, in connect_tcp return await self._backend.connect_tcp(
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 113, in connect_tcp with map_exceptions(exc_map):
 File "/Users/smujahid/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ConnectTimeout The above exception was the direct cause of the following exception: Traceback (most recent call last):
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/_internal/_runnable.py", line 705, in ainvoke input = await asyncio.create_task(
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/_internal/_runnable.py", line 473, in ainvoke ret = await self.afunc(*args, **kwargs)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/prebuilt/tool_node.py", line 749, in _afunc outputs = await asyncio.gather(*coros)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/prebuilt/tool_node.py", line 1088, in _arun_one return await self._execute_tool_async(tool_request, input_type, config)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/prebuilt/tool_node.py", line 1037, in _execute_tool_async content = _handle_tool_error(e, flag=self._handle_tool_errors)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/prebuilt/tool_node.py", line 401, in _handle_tool_error content = flag(e) # type: ignore [assignment, call-arg]
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/prebuilt/tool_node.py", line 358, in _default_handle_tool_errors raise e
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langgraph/prebuilt/tool_node.py", line 990, in _execute_tool_async response = await tool.ainvoke(call_args, config)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langchain_core/tools/structured.py", line 66, in ainvoke return await super().ainvoke(input, config, **kwargs)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langchain_core/tools/base.py", line 634, in ainvoke return await self.arun(tool_input, **kwargs)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langchain_core/tools/base.py", line 1081, in arun raise error_to_raise
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langchain_core/tools/base.py", line 1047, in arun response = await coro_with_context(coro, context)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/langchain_core/tools/structured.py", line 120, in _arun return await self.coroutine(*args, **kwargs)
 File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/code_review/langchain_tools.py", line 45, in expand_context file_content = await runtime.context.patch.get_new_file(file_path)
 File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/core/platforms/phabricator.py", line 368, in get_new_file return await self._get_file(file_path, is_before_patch=False)
 File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/core/platforms/phabricator.py", line 356, in _get_file return await self._get_file_from_patch(
 File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/core/platforms/phabricator.py", line 330, in _get_file_from_patch r = await client.get(
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1768, in get return await self.request(
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1540, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1629, in send response = await self._send_handling_auth(
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1657, in _send_handling_auth response = await self._send_handling_redirects(
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects response = await self._send_single_request(request)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1730, in _send_single_request response = await transport.handle_async_request(request)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 393, in handle_async_request with map_httpcore_exceptions():
 File "/Users/smujahid/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value)
 File "/Users/smujahid/repos/mozilla/bugbug/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectTimeout

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in bugbug/tools/core/platforms/phabricator.py at _get_file_from_patch(), especially the client.get call around line 330, and trace how get_new_file reaches it. Reproduce or inspect the reported httpx.ConnectTimeout, then check nearby file-fetching paths for the intended error behavior. Done should include a verified resolution for this timeout case and a regression test if the existing test structure supports one.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.