{"record":{"id":"55c4f6135230ca23","repo":"remix-run/react-router","slug":"there-was-a-problem-fetching-the-file-isgithuburl-55c4f6","errorCode":null,"errorMessage":"There was a problem fetching the file${isGithubUrl ? \" from GitHub\" : \"\"}. The request responded with a ${response.status} status. Please try again later.","messagePattern":"There was a problem fetching the file(.+?)\\. 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":277,"sourceCode":"          \"found at that url. Please try again later.\",\n      );\n    }\n    resourceUrl = `https://api.github.com/repos/${info.owner}/${info.name}/releases/assets/${assetId}`;\n    headers.Accept = \"application/octet-stream\";\n  }\n  let response = await fetch(resourceUrl, { headers });\n\n  if (!response.body || response.status !== 200) {\n    if (token) {\n      throw new CopyTemplateError(\n        `There was a problem fetching the file${\n          isGithubUrl ? \" from GitHub\" : \"\"\n        }. The request ` +\n          `responded with a ${response.status} status. Perhaps your \\`--token\\`` +\n          \"is expired or invalid.\",\n      );\n    }\n    throw new CopyTemplateError(\n      `There was a problem fetching the file${\n        isGithubUrl ? \" from GitHub\" : \"\"\n      }. The request ` +\n        `responded with a ${response.status} status. Please try again later.`,\n    );\n  }\n\n  // file paths returned from GitHub are always unix style\n  if (filePath) {\n    filePath = filePath.split(path.sep).join(path.posix.sep);\n  }\n\n  let filePathHasFiles = false;\n\n  try {\n    let input = new stream.PassThrough();\n    // Start reading stream into passthrough, don't await to avoid buffering\n    writeReadableStreamToWritable(response.body, input);","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/remix-run/react-router/blob/6beaca39526d5716c3c112ebb0782765baa5a9ce/packages/create-react-router/copy-template.ts#L259-L295","documentation":"The tarball download (codeload.github.com tarball, api.github.com tarball redirect, or generic URL) failed with a non-200 status and no token was supplied. Because no credentials were involved, this points at the resource itself or transient conditions: 404 for a nonexistent or private repo/branch, 403 from GitHub API rate limiting, or 5xx during a GitHub incident.","triggerScenarios":"Scaffolding from a private repo without --token (404); a deleted or renamed branch in a /tree/:branch URL; unauthenticated GitHub API quota exhausted (60 requests/hour per IP); transient GitHub outage or network failure.","commonSituations":"Template repos moved or deleted; typos in branch names; CI runners on shared IPs exhausting the unauthenticated quota; flaky networks.","solutions":["If the repo is private, pass --token with a PAT that can read it","Verify the repo and branch exist by opening the URL in a browser","Check rate limits: curl https://api.github.com/rate_limit","Retry after a few minutes for transient failures or incidents"],"exampleFix":"# before: private repo, no token -> 404\nnpx create-react-router my-app --template https://github.com/acme/private-tpl/tree/main\n\n# after: supply a token with read access\nnpx create-react-router my-app --token \"$GH_TOKEN\" \\\n  --template https://github.com/acme/private-tpl/tree/main","handlingStrategy":"retry","validationCode":"async function repoIsPubliclyFetchable(owner: string, repo: string, branch?: string) {\n  const res = await fetch(\n    `https://api.github.com/repos/${owner}/${repo}` + (branch ? `/branches/${branch}` : \"\"),\n  );\n  if (res.status === 404) {\n    throw new Error(\"Repo/branch missing or private — pass --token\");\n  }\n  if (res.status === 403) {\n    throw new Error(\"Rate limited — export GITHUB_TOKEN or retry later\");\n  }\n  return res.ok;\n}","typeGuard":null,"tryCatchPattern":"async function scaffoldWithBackoff(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 retryable = /problem fetching the file/.test(msg) && !/404/.test(msg);\n      if (!retryable || i === attempts - 1) throw e;\n      await new Promise((r) => setTimeout(r, 2 ** i * 5_000));\n    }\n  }\n}","preventionTips":["Export GITHUB_TOKEN in CI even for public template repos to avoid the 60 req/h anonymous quota","Pass --token for any template repo that might be private","Verify branch names when pinning /tree/:branch URLs"],"tags":["network","github-api","rate-limit","cli"],"backgroundTag":"http-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"}