can1357/oh-my-pi · error · Error

Timed out fetching GitHub release metadata after 30s

Error message

Timed out fetching GitHub release metadata after 30s

What it means

getReleaseBinaryAsset fetches release metadata from the GitHub API with a 30-second timeout (RELEASE_METADATA_TIMEOUT_MS). When the request aborts due to the timeout, the code rewraps the AbortError with this clearer message (original error preserved as `cause`). The updater cannot proceed without release metadata.

Source

Thrown at packages/coding-agent/src/cli/update-cli.ts:266

	githubToken: string | undefined = $env.GITHUB_TOKEN || $env.GH_TOKEN,
	allowPrerelease = false,
): Promise<ReleaseBinaryAsset> {
	const tag = `v${expectedVersion}`;
	const headers: Record<string, string> = {
		Accept: "application/vnd.github+json",
		"X-GitHub-Api-Version": "2022-11-28",
	};
	if (githubToken) headers.Authorization = `Bearer ${githubToken}`;

	let response: Response;
	try {
		response = await fetchImpl(`${GITHUB_API}/repos/${REPO}/releases/tags/${encodeURIComponent(tag)}`, {
			headers,
			signal: withTimeoutSignal(RELEASE_METADATA_TIMEOUT_MS),
		});
	} catch (err) {
		if (isTimeoutError(err)) {
			throw new Error("Timed out fetching GitHub release metadata after 30s", { cause: err });
		}
		if (isUnsupportedProxyError(err)) throw new Error(unsupportedProxyMessage(), { cause: err });
		throw err;
	}
	if ((response.status === 403 && !githubToken) || response.status === 429) {
		throw new Error(
			"GitHub API rate limit exceeded while fetching release metadata; retry later or set GITHUB_TOKEN or GH_TOKEN",
		);
	}
	if (!response.ok) {
		throw new Error(`Failed to fetch GitHub release metadata: ${response.statusText}`);
	}

	return resolveReleaseBinaryAsset(await response.json(), tag, binaryName, { allowPrerelease });
}

export interface VerifiedBinaryDownloadOptions {
	url: string;

View on GitHub (pinned to 9690622007)

Solutions

  1. Retry the update — transient latency is the most common cause.
  2. Check connectivity to the API: curl -m 30 https://api.github.com/repos/<owner>/<repo>/releases/tags/<tag>.
  3. Check GitHub status (https://www.githubstatus.com) for API incidents.
  4. Inspect HTTP(S)_PROXY settings — a slow proxy can exceed the 30s budget; also check for SOCKS proxies (see the unsupported-proxy error).
Defensive patterns

Strategy: retry

Try / catch

for (let attempt = 1; attempt <= 3; attempt++) {
  try { await update(); return; }
  catch (err) {
    if (err instanceof Error && err.message.includes("Timed out fetching GitHub release metadata") && attempt < 3) {
      await Bun.sleep(2_000 * attempt);
      continue;
    }
    throw err;
  }
}

Prevention

When it happens

Trigger: The fetch to `${GITHUB_API}/repos/${REPO}/releases/tags/${tag}` with `withTimeoutSignal(30000)` rejects with a timeout/abort error — the API did not respond within 30 seconds.

Common situations: Slow or saturated networks, corporate proxies delaying TLS handshakes, DNS resolution hangs, GitHub API incidents/outages, or VPN/firewall throttling api.github.com.

Understand the failure class

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/91cf01d70f175ea4. Report an issue: GitHub.