langchain-ai/deepagents · error · TimeoutError
Download of {url} exceeded {_DOWNLOAD_TIMEOUT_SECONDS}s dead
Error message
Download of {url} exceeded {_DOWNLOAD_TIMEOUT_SECONDS}s deadline What it means
`_download_to` raises `TimeoutError` when downloading a managed tool (e.g. ripgrep) exceeds the fixed `_DOWNLOAD_TIMEOUT_SECONDS` deadline, measured with `time.monotonic()`. This prevents a stalled connection from hanging installation indefinitely.
Source
Thrown at libs/code/deepagents_code/managed_tools.py:569
import time
import urllib.error
import urllib.request
deadline = time.monotonic() + _DOWNLOAD_TIMEOUT_SECONDS
with (
urllib.request.urlopen(url, timeout=_DOWNLOAD_TIMEOUT_SECONDS) as resp, # noqa: S310 # fixed https GitHub release URL
dest.open("wb") as fh,
):
status = getattr(resp, "status", None)
if status is not None and status != 200: # noqa: PLR2004 # HTTP 200 OK
msg = f"Unexpected HTTP {status} response fetching {url}"
raise urllib.error.URLError(msg)
while True:
if time.monotonic() > deadline:
msg = (
f"Download of {url} exceeded {_DOWNLOAD_TIMEOUT_SECONDS}s deadline"
)
raise TimeoutError(msg)
chunk = resp.read(_DOWNLOAD_CHUNK_BYTES)
if not chunk:
break
fh.write(chunk)
def _sha256(path: Path) -> str:
"""Return the SHA-256 hex digest of `path`."""
import hashlib
digest = hashlib.sha256()
with path.open("rb") as fh:
for chunk in iter(lambda: fh.read(1 << 20), b""):
digest.update(chunk)
return digest.hexdigest()
def _verify_sha256(path: Path, expected_hex: str) -> None:View on GitHub (pinned to a1af029e6e)
Solutions
- Retry the install when the network is faster (the operation is safe to rerun)
- Pre-provision the tool manually so the download path is skipped, or point any configured mirror/download URL at a faster host
- Check proxy/VPN throughput and disable throttling middleboxes; if a proxy is required, ensure it is configured for the process
Example fix
// before $ dcode install-tools # times out on hotel Wi-Fi // after $ networksetup -setairportpower en0 off && networksetup -setairportpower en0 on # reset link $ dcode install-tools # retry once connection is stable // or pre-provision rg on PATH so no download is needed
Defensive patterns
Strategy: retry
Validate before calling
import socket
# quick reachability probe before starting the (deadline-bound) download
host = "github.com"
try:
socket.create_connection((host, 443), timeout=5).close()
except OSError:
raise SystemExit("no network connectivity; fix connection before install") Try / catch
try:
_install_ripgrep_sync()
except TimeoutError as exc:
logger.warning("tool download too slow: %s; retrying once", exc)
_install_ripgrep_sync() # retry, or fall back to system rg if present Prevention
- Install managed tools on a stable connection, not captive-portal Wi-Fi
- Configure proxy settings before first run so downloads use the fast path
- Pre-provision rg on PATH to skip the download entirely
When it happens
Trigger: `_install_ripgrep_sync` triggering a download on a slow or throttled network, a stalled/stuck connection where `resp.read()` blocks, or a very large artifact on a low-bandwidth link (VPN, corporate proxy, CI runner with limited egress).
Common situations: Flaky Wi-Fi or satellite links; corporate proxies buffering slowly; CI runners in constrained regions; GitHub release CDN throttling.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Server did not become healthy within {timeout}s
- Server graph '{graph_name}' did not initialize within {timeo
- Failed to run git: {redact_urls_in_text(str(exc))}
- Failed to download marketplace from {_redact_url_credentials
- Runloop API unreachable (transient — safe to retry): {e}
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/4abfeadd857d9ad4.
Report an issue: GitHub.