{"record":{"id":"08df4818d07d6ad9","repo":"remix-run/react-router","slug":"there-was-a-problem-fetching-the-file-from-github","errorCode":null,"errorMessage":"There was a problem fetching the file from GitHub. The request responded with a ${response.status} status. Please try again later.","messagePattern":"There was a problem fetching the file from GitHub\\. The request responded with a (.+?) status\\. Please try again later\\.","errorType":"exception","errorClass":"CopyTemplateError","httpStatus":null,"severity":"error","filePath":"packages/create-react-router/copy-template.ts","lineNumber":231,"sourceCode":"  let isGithubUrl = new URL(tarballUrl).host.endsWith(\"github.com\");\n  if (token && isGithubUrl) {\n    headers.Authorization = `token ${token}`;\n  }\n  if (isGithubReleaseAssetUrl(tarballUrl)) {\n    // We can download the asset via the GitHub api, but first we need to look\n    // up the asset id\n    let info = getGithubReleaseAssetInfo(tarballUrl);\n    headers.Accept = \"application/vnd.github.v3+json\";\n\n    let releaseUrl =\n      info.tag === \"latest\"\n        ? `https://api.github.com/repos/${info.owner}/${info.name}/releases/latest`\n        : `https://api.github.com/repos/${info.owner}/${info.name}/releases/tags/${info.tag}`;\n\n    let response = await fetch(releaseUrl, { headers });\n\n    if (response.status !== 200) {\n      throw new CopyTemplateError(\n        \"There was a problem fetching the file from GitHub. The request \" +\n          `responded with a ${response.status} status. Please try again later.`,\n      );\n    }\n\n    let body = (await response.json()) as { assets: GitHubApiReleaseAsset[] };\n    if (\n      !body ||\n      typeof body !== \"object\" ||\n      !body.assets ||\n      !Array.isArray(body.assets)\n    ) {\n      throw new CopyTemplateError(\n        \"There was a problem fetching the file from GitHub. No asset was \" +\n          \"found at that url. Please try again later.\",\n      );\n    }\n","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/remix-run/react-router/blob/6beaca39526d5716c3c112ebb0782765baa5a9ce/packages/create-react-router/copy-template.ts#L213-L249","documentation":"When the template URL is a GitHub release asset URL (containing /releases/download/ or /releases/latest/download/), the CLI first queries api.github.com for the release metadata to look up the asset id. This error means that API call returned a non-200 status: 404 (repo or tag does not exist), 401 (bad credentials), or 403 (rate limit exceeded).","triggerScenarios":"Template URL references a deleted repo, a nonexistent or draft tag, or a repo with no releases when using /releases/latest/; a revoked --token; unauthenticated GitHub API rate limiting (60 requests/hour per IP) in CI.","commonSituations":"Shared CI runners behind one NAT exhausting the unauthenticated quota; typos in tag names; draft releases not visible to the API without auth; rotated tokens.","solutions":["Open the release URL in a browser to confirm the repo, tag, and asset exist","If using --token, verify it is valid and has access to the repo","Check rate limits: curl https://api.github.com/rate_limit — wait and retry when exhausted","Prefer the exact form /releases/download/<tag>/<asset>.tar.gz over /releases/latest/download/"],"exampleFix":"# before (tag typo)\nnpx create-react-router my-app --token $GH_TOKEN \\\n  --template https://github.com/acme/templates/releases/download/v1.0/template.tar.gz\n\n# after: confirm the tag exists, then use the exact asset URL\ncurl -s https://api.github.com/repos/acme/templates/releases | grep tag_name\nnpx create-react-router my-app --token $GH_TOKEN \\\n  --template https://github.com/acme/templates/releases/download/v1.0.0/template.tar.gz","handlingStrategy":"retry","validationCode":"async function preflightRelease(owner: string, repo: string, tag: string, token?: string) {\n  const headers: Record<string, string> = { Accept: \"application/vnd.github.v3+json\" };\n  if (token) headers.Authorization = `token ${token}`;\n  const res = await fetch(\n    `https://api.github.com/repos/${owner}/${repo}/releases/tags/${tag}`,\n    { headers },\n  );\n  if (res.status === 404) throw new Error(`Release ${tag} not found in ${owner}/${repo}`);\n  if (res.status === 401) throw new Error(\"Token invalid\");\n  if (res.status === 403) throw new Error(\"Rate limited — set GITHUB_TOKEN or wait\");\n  if (!res.ok) throw new Error(`GitHub API ${res.status}`);\n  return res.json();\n}","typeGuard":null,"tryCatchPattern":"async function scaffoldWithRetry(args: string[], attempts = 3) {\n  for (let i = 0; i < attempts; i++) {\n    try {\n      return await createReactRouter(args);\n    } catch (e) {\n      const msg = e instanceof Error ? e.message : String(e);\n      const transient = /problem fetching the file from GitHub/.test(msg) && !/404|401/.test(msg);\n      if (!transient || i === attempts - 1) throw e;\n      await new Promise((r) => setTimeout(r, 2 ** i * 5_000));\n    }\n  }\n}","preventionTips":["Always export GITHUB_TOKEN / pass --token in CI to raise the API quota from 60/h to 5000/h","Pin exact release tags instead of 'latest' in cached scripts","Check api.github.com/rate_limit before large scaffold batches"],"tags":["network","github-api","release","rate-limit"],"backgroundTag":"github-api-request-failed","analyzedSha":"6beaca39526d5716c3c112ebb0782765baa5a9ce","analyzedAt":"2026-08-18T18:04:14.938Z","contentChangedAt":"2026-08-18T18:04:14.938Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}