Title: web_fetch tool fails on all URLs (TypeError: fetch failed) in IPv4-only sandbox environments · Issue #4041 · github/copilot-cli · GitHub
Open Graph Title: web_fetch tool fails on all URLs (TypeError: fetch failed) in IPv4-only sandbox environments · Issue #4041 · github/copilot-cli
X Title: web_fetch tool fails on all URLs (TypeError: fetch failed) in IPv4-only sandbox environments · Issue #4041 · github/copilot-cli
Description: Description The built-in web_fetch tool fails on every URL, including trivial always-up test sites (e.g. https://example.com), returning a generic error: TypeError: fetch failed This happens both with raw: true and default markdown mode,...
Open Graph Description: Description The built-in web_fetch tool fails on every URL, including trivial always-up test sites (e.g. https://example.com), returning a generic error: TypeError: fetch failed This happens both w...
X Description: Description The built-in web_fetch tool fails on every URL, including trivial always-up test sites (e.g. https://example.com), returning a generic error: TypeError: fetch failed This happens both w...
Opengraph URL: https://github.com/github/copilot-cli/issues/4041
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"web_fetch tool fails on all URLs (TypeError: fetch failed) in IPv4-only sandbox environments","articleBody":"### Description\n\nThe built-in `web_fetch` tool fails on **every** URL, including trivial always-up test sites (e.g. `https://example.com`), returning a generic error:\n\n```\nTypeError: fetch failed\n```\n\nThis happens both with `raw: true` and default markdown mode, and regardless of the target site (tested `https://example.com` and `https://www.intel.com/...`).\n\n### Environment\n\n- CLI version: 1.0.68\n- OS: Linux (Copilot CLI cloud/session sandbox)\n- Host network: no global IPv6 address on the primary interface (`eth0` only has a link-local `fe80::/64` address; `ip -6 route show` shows no default IPv6 route)\n\n### Steps to reproduce\n\n1. In a Copilot CLI session, invoke the `web_fetch` tool against `https://example.com`.\n2. Observe `TypeError: fetch failed` with no further detail.\n\n### Diagnosis / evidence that this is not a general network outage\n\nFrom the same session's bash shell:\n- `curl https://example.com` → succeeds (`HTTP 200`)\n- `curl -4 https://example.com` (IPv4 forced) → succeeds consistently\n- `curl -6 https://example.com` (IPv6 forced) → fails consistently: `Failed to connect to example.com port 443 ... Couldn't connect to server`\n- Plain Node `fetch()` (same Node runtime available in the sandbox, v24.13.0) → succeeds, because Node's `fetch`/undici implementation performs Happy-Eyeballs-style fallback from IPv6 to IPv4 automatically\n- DNS resolves both `A` (IPv4) and `AAAA` (IPv6) records for the target domains\n\nThis strongly suggests the `web_fetch` tool's underlying HTTP client attempts the IPv6 (`AAAA`) address first (as returned by DNS) and does not fall back to IPv4 on failure, causing an immediate, opaque `TypeError: fetch failed` in environments where IPv6 egress is unavailable (no global IPv6 address/route on the host, only link-local).\n\nI even tried disabling IPv6 system-wide on the sandbox host via `sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1` (and `default`) — `curl`/Node fetch continued to work fine afterward, but `web_fetch` still failed identically. This indicates `web_fetch` likely executes in a separate process/container from the interactive bash sandbox, so host-level network changes made from within the session don't reach it — the fix needs to happen wherever that tool's HTTP client actually runs.\n\n### Expected behavior\n\n`web_fetch` should successfully fetch pages in environments with IPv4-only egress, ideally by:\n- Implementing Happy Eyeballs / IPv4 fallback when IPv6 connection attempts fail, and/or\n- Surfacing a more actionable error message (e.g., distinguishing DNS failure vs. connection refused vs. TLS failure) instead of a generic `TypeError: fetch failed`.\n\n### Workaround\n\nUsing `curl` via the `bash` tool as a substitute for `web_fetch` works reliably in the same session.\n","author":{"url":"https://github.com/lanrebr","@type":"Person","name":"lanrebr"},"datePublished":"2026-07-07T03:47:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/4041/copilot-cli/issues/4041"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5adf1c63-e183-1157-8be3-6014f9d6a630 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B64:4D83E:CBF891:117F833:6A4DCCF6 |
| html-safe-nonce | 04eb6eb0e27f9842b9e59dcd5acb56f7da35fab4fe1eb3b8d6881ddb49d465a7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjY0OjREODNFOkNCRjg5MToxMTdGODMzOjZBNERDQ0Y2IiwidmlzaXRvcl9pZCI6IjI1NzYzMzgxMjcxNTM5MDg5ODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 85b9ddf2fb638bda6f61cbe7046b1d43808df081359404c5e02b9247e2b927dd |
| hovercard-subject-tag | issue:4825044112 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/copilot-cli/4041/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e5a1e325f7ee3aa6dda37580ac2991b7448ded4376edef43ee2c30244359c87b/github/copilot-cli/issues/4041 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e5a1e325f7ee3aa6dda37580ac2991b7448ded4376edef43ee2c30244359c87b/github/copilot-cli/issues/4041 |
| og:image:alt | Description The built-in web_fetch tool fails on every URL, including trivial always-up test sites (e.g. https://example.com), returning a generic error: TypeError: fetch failed This happens both w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lanrebr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/github/copilot-cli git https://github.com/github/copilot-cli.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 585860664 |
| octolytics-dimension-repository_nwo | github/copilot-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 585860664 |
| octolytics-dimension-repository_network_root_nwo | github/copilot-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width