{"record":{"id":"84d213ee4880a548","repo":"can1357/oh-my-pi","slug":"proxy-configuration-uses-a-scheme-bun-s-fetch-cann","errorCode":null,"errorMessage":"Proxy configuration uses a scheme Bun's fetch cannot use${detail}. Only http:// and https:// proxies are supported — SOCKS proxies (socks5://, socks5h://) are not. Point HTTP_PROXY/HTTPS_PROXY at an http:// proxy URL or unset the proxy variables, then retry.","messagePattern":"Proxy configuration uses a scheme Bun's fetch cannot use(.+?)\\. Only http:// and https:// proxies are supported — SOCKS proxies \\(socks5://, socks5h://\\) are not\\. Point HTTP_PROXY/HTTPS_PROXY at an http:// proxy URL or unset the proxy variables, then retry\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/update-cli.ts","lineNumber":268,"sourceCode":"): Promise<ReleaseBinaryAsset> {\n\tconst tag = `v${expectedVersion}`;\n\tconst headers: Record<string, string> = {\n\t\tAccept: \"application/vnd.github+json\",\n\t\t\"X-GitHub-Api-Version\": \"2022-11-28\",\n\t};\n\tif (githubToken) headers.Authorization = `Bearer ${githubToken}`;\n\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetchImpl(`${GITHUB_API}/repos/${REPO}/releases/tags/${encodeURIComponent(tag)}`, {\n\t\t\theaders,\n\t\t\tsignal: withTimeoutSignal(RELEASE_METADATA_TIMEOUT_MS),\n\t\t});\n\t} catch (err) {\n\t\tif (isTimeoutError(err)) {\n\t\t\tthrow new Error(\"Timed out fetching GitHub release metadata after 30s\", { cause: err });\n\t\t}\n\t\tif (isUnsupportedProxyError(err)) throw new Error(unsupportedProxyMessage(), { cause: err });\n\t\tthrow err;\n\t}\n\tif ((response.status === 403 && !githubToken) || response.status === 429) {\n\t\tthrow new Error(\n\t\t\t\"GitHub API rate limit exceeded while fetching release metadata; retry later or set GITHUB_TOKEN or GH_TOKEN\",\n\t\t);\n\t}\n\tif (!response.ok) {\n\t\tthrow new Error(`Failed to fetch GitHub release metadata: ${response.statusText}`);\n\t}\n\n\treturn resolveReleaseBinaryAsset(await response.json(), tag, binaryName, { allowPrerelease });\n}\n\nexport interface VerifiedBinaryDownloadOptions {\n\turl: string;\n\ttargetPath: string;\n\texpectedSize: number;","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/update-cli.ts#L250-L286","documentation":"Bun's fetch only supports HTTP(S) proxies via HTTP_PROXY/HTTPS_PROXY. When the release-metadata request fails and isUnsupportedProxyError detects the proxy URL uses an unsupported scheme (e.g. socks5://, socks5h://), the error is rewrapped with this actionable message explaining the limitation and the fix.","triggerScenarios":"getReleaseBinaryAsset's fetch throws, isUnsupportedProxyError(err) is true — i.e. HTTP_PROXY/HTTPS_PROXY/ALL_PROXY is set to a SOCKS (or other non-http/https) scheme and Bun's fetch rejects it.","commonSituations":"Corporate or personal environments routing traffic through a local SOCKS proxy (SSH -D tunnels, Clash, v2ray, Tor) with `export HTTPS_PROXY=socks5://127.0.0.1:1080`, then running `omp update`.","solutions":["Point HTTP_PROXY/HTTPS_PROXY at an HTTP proxy URL, e.g. export HTTPS_PROXY=http://127.0.0.1:1080 (most SOCKS clients expose a mixed/http port).","Unset the proxy variables for this run: env -u HTTP_PROXY -u HTTPS_PROXY omp update.","Use a tool like privoxy/gost to bridge SOCKS to an HTTP proxy and point the env vars at it.","Run the update on a network that reaches api.github.com directly."],"exampleFix":"// before\nexport HTTPS_PROXY=socks5://127.0.0.1:1080\n// after\nexport HTTPS_PROXY=http://127.0.0.1:7890","handlingStrategy":"validation","validationCode":"const proxy = process.env.HTTPS_PROXY ?? process.env.https_proxy ?? process.env.HTTP_PROXY ?? process.env.http_proxy;\nif (proxy && !/^https?:\\/\\//i.test(proxy)) {\n  console.error(`Proxy ${proxy} uses a scheme Bun fetch cannot use; set an http:// proxy or unset the variable.`);\n  process.exit(1);\n}","typeGuard":"function isSupportedProxy(proxy: string): boolean {\n  try { return [\"http:\", \"https:\"].includes(new URL(proxy).protocol); } catch { return false; }\n}","tryCatchPattern":"try {\n  await update();\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"scheme Bun's fetch cannot use\")) {\n    console.error(\"Switch HTTP_PROXY/HTTPS_PROXY to an http:// proxy URL (or unset them) and retry.\");\n  } else throw err;\n}","preventionTips":["Prefer http:// proxy URLs in HTTP_PROXY/HTTPS_PROXY; expose your SOCKS client's mixed HTTP port.","Bridge SOCKS-only setups with privoxy/gost if you must proxy.","Validate proxy env vars at shell startup if you routinely run network tooling."],"tags":["network","proxy","socks","update","environment"],"backgroundTag":"unsupported-proxy-scheme","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}