{"record":{"id":"768a6336fa4bab76","repo":"browser-use/browser-use","slug":"could-not-fetch-templates-from-github-check-your","errorCode":null,"errorMessage":"Could not fetch templates from GitHub. Check your internet connection.","messagePattern":"Could not fetch templates from GitHub\\. Check your internet connection\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"browser_use/init_cmd.py","lineNumber":59,"sourceCode":"\ttry:\n\t\turl = f'{TEMPLATE_REPO_URL}/templates.json'\n\t\twith request.urlopen(url, timeout=5) as response:\n\t\t\tdata = response.read().decode('utf-8')\n\t\t\treturn json.loads(data)\n\texcept (URLError, TimeoutError, json.JSONDecodeError, Exception):\n\t\treturn None\n\n\ndef _get_template_list() -> dict[str, Any]:\n\t\"\"\"\n\tGet template list from GitHub.\n\n\tRaises FileNotFoundError if GitHub fetch fails.\n\t\"\"\"\n\ttemplates = _fetch_template_list()\n\tif templates is not None:\n\t\treturn templates\n\traise FileNotFoundError('Could not fetch templates from GitHub. Check your internet connection.')\n\n\ndef _fetch_from_github(file_path: str) -> str | None:\n\t\"\"\"\n\tFetch template file from GitHub.\n\n\tReturns file content if successful, None if failed.\n\t\"\"\"\n\ttry:\n\t\turl = f'{TEMPLATE_REPO_URL}/{file_path}'\n\t\twith request.urlopen(url, timeout=5) as response:\n\t\t\treturn response.read().decode('utf-8')\n\texcept (URLError, TimeoutError, Exception):\n\t\treturn None\n\n\ndef _fetch_binary_from_github(file_path: str) -> bytes | None:\n\t\"\"\"","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/browser-use/browser-use/blob/6c73fced2f6d45a11d88622fe56365a5fe18f28b/browser_use/init_cmd.py#L41-L77","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corporate networks with TLS inspection blocking GitHub; CI sandboxes without egress; transient GitHub outages; slow connections exceeding the 5-second timeout.","solutions":["Check connectivity to the template repo URL (curl the TEMPLATE_REPO_URL) and fix proxy/DNS/firewall issues","Set HTTPS_PROXY/HTTP_PROXY if a proxy is required for egress","Retry later if GitHub is rate-limiting or having an incident","If offline, scaffold the project manually instead of via the init command"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"from urllib import request as _rq\ntry:\n    with _rq.urlopen(TEMPLATE_REPO_URL, timeout=5) as r:\n        r.read(1)  # connectivity smoke test\n    online = True\nexcept Exception:\n    online = False","typeGuard":null,"tryCatchPattern":"import time\nfor attempt in range(3):\n    try:\n        templates = _get_template_list()\n        break\n    except FileNotFoundError:\n        if attempt == 2:\n            raise\n        time.sleep(2)","preventionTips":["Verify egress to GitHub (proxy, DNS, firewall) before running init in locked-down networks","Set HTTPS_PROXY when a corporate proxy is required","Keep a manually scaffolded project as an offline fallback"],"tags":["cli","network","github","init"],"backgroundTag":null,"analyzedSha":"6c73fced2f6d45a11d88622fe56365a5fe18f28b","analyzedAt":"2026-08-14T19:42:40.557Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}