browser-use/browser-use · error · FileNotFoundError

Could not fetch templates from GitHub. Check your internet c

Error message

Could not fetch templates from GitHub. Check your internet connection.

What it means

Raised by _get_template_list in the `browser-use init` CLI: fetching the template index from the template GitHub repo failed (urlopen raised or returned None within its 5s timeout), so the interactive template picker has nothing to show. It surfaces as FileNotFoundError even though the root cause is network/HTTP, not a missing file.

Source

Thrown at browser_use/init_cmd.py:59

	try:
		url = f'{TEMPLATE_REPO_URL}/templates.json'
		with request.urlopen(url, timeout=5) as response:
			data = response.read().decode('utf-8')
			return json.loads(data)
	except (URLError, TimeoutError, json.JSONDecodeError, Exception):
		return None


def _get_template_list() -> dict[str, Any]:
	"""
	Get template list from GitHub.

	Raises FileNotFoundError if GitHub fetch fails.
	"""
	templates = _fetch_template_list()
	if templates is not None:
		return templates
	raise FileNotFoundError('Could not fetch templates from GitHub. Check your internet connection.')


def _fetch_from_github(file_path: str) -> str | None:
	"""
	Fetch template file from GitHub.

	Returns file content if successful, None if failed.
	"""
	try:
		url = f'{TEMPLATE_REPO_URL}/{file_path}'
		with request.urlopen(url, timeout=5) as response:
			return response.read().decode('utf-8')
	except (URLError, TimeoutError, Exception):
		return None


def _fetch_binary_from_github(file_path: str) -> bytes | None:
	"""

View on GitHub (pinned to 6c73fced2f)

Solutions

  1. Check connectivity to the template repo URL (curl the TEMPLATE_REPO_URL) and fix proxy/DNS/firewall issues
  2. Set HTTPS_PROXY/HTTP_PROXY if a proxy is required for egress
  3. Retry later if GitHub is rate-limiting or having an incident
  4. If offline, scaffold the project manually instead of via the init command
Defensive patterns

Strategy: retry

Validate before calling

from urllib import request as _rq
try:
    with _rq.urlopen(TEMPLATE_REPO_URL, timeout=5) as r:
        r.read(1)  # connectivity smoke test
    online = True
except Exception:
    online = False

Try / catch

import time
for attempt in range(3):
    try:
        templates = _get_template_list()
        break
    except FileNotFoundError:
        if attempt == 2:
            raise
        time.sleep(2)

Prevention

When it happens

Trigger: Running `browser-use init` with no internet; behind a corporate proxy that blocks raw.githubusercontent.com; GitHub rate-limiting or returning 5xx; DNS failure in a sandboxed container.

Common situations: Corporate networks with TLS inspection blocking GitHub; CI sandboxes without egress; transient GitHub outages; slow connections exceeding the 5-second timeout.

Related errors


AI-assisted analysis of browser-use/browser-use@6c73fced2f (2026-08-14). Data as JSON: /api/errors/768a6336fa4bab76. Report an issue: GitHub.