{"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/1fd704a7dabcbe3ae09d7387b460e6acaba30ec1/packages/create-react-router/copy-template.ts#L213-L249","documentation":"Thrown inside downloadAndExtractTarball() when the GitHub Releases API endpoint (api.github.com/repos/:owner/:name/releases/latest or .../tags/:tag) responds with a status other than 200. This branch runs only for URLs detected as GitHub release asset URLs (containing /releases/download/). A non-200 status typically means the tag/release does not exist (404), the repo is private/inaccessible (404/401), or you have been rate-limited (403).","triggerScenarios":"Passing --template https://github.com/:owner/:repo/releases/download/:tag/template.tar.gz where :tag does not exist; the release was deleted or made draft after publishing the URL; the repository is private and no --token was supplied; GitHub API rate limit exceeded (403 with remaining: 0).","commonSituations":"CI hits the unauthenticated 60 req/hour GitHub rate limit; the release tag was renamed (e.g. v1.0 -> v1.0.0); a private fork whose release is not accessible; typoing the owner or repo segment in the URL.","solutions":["Open the URL in a browser to confirm the release and asset exist; if 404, find the correct tag.","For private repos or to raise rate limits, generate a GitHub personal access token and pass --token <PAT>.","If rate-limited, wait for the limit window to reset (check X-RateLimit-Reset header) or authenticate.","Verify the owner/repo/tag spelling in the --template URL exactly matches the GitHub UI."],"exampleFix":"// before\ncreate-react-router my-app --template https://github.com/acme/templates/releases/download/v0.1.0/app.tar.gz\n// after (release was retagged, and use a token for private repo)\ncreate-react-router my-app --token $GITHUB_TOKEN --template https://github.com/acme/templates/releases/download/v0.2.0/app.tar.gz","handlingStrategy":"retry","validationCode":"// Pre-check the release exists and you can reach the API\nasync function releaseReachable(owner: string, repo: string, tag: string, token?: string) {\n  const url = tag === 'latest'\n    ? `https://api.github.com/repos/${owner}/${repo}/releases/latest`\n    : `https://api.github.com/repos/${owner}/${repo}/releases/tags/${tag}`;\n  const h: HeadersInit = { Accept: 'application/vnd.github.v3+json' };\n  if (token) h.Authorization = `token ${token}`;\n  const r = await fetch(url, { headers: h });\n  if (r.status === 403) console.warn('rate-limited or forbidden');\n  return r.status === 200;\n}","typeGuard":null,"tryCatchPattern":"try { await copyTemplate(url, dest, opts); }\ncatch (e) {\n  if (e instanceof CopyTemplateError && /responded with a 40(3|4) status/.test(e.message)) {\n    // back off and retry up to N times with exponential delay (rate limit / transient)\n  } else throw e;\n}","preventionTips":["Pass --token in CI to raise the GitHub API rate limit.","Pin release tags that you have verified exist.","Check X-RateLimit-Remaining when automating many invocations.","Cache the resolved template locally and reuse it across runs."],"tags":["network","github-api","rate-limit","release","create-react-router"],"backgroundTag":null,"analyzedSha":"1fd704a7dabcbe3ae09d7387b460e6acaba30ec1","analyzedAt":"2026-08-12T13:54:57.804Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}