{"record":{"id":"b2e2304750901dc6","repo":"yamadashy/repomix","slug":"repository-not-found-or-is-private-please-check-t","errorCode":null,"errorMessage":"Repository not found or is private. Please check the repository URL and your access permissions.","messagePattern":"Repository not found or is private\\. Please check the repository URL and your access permissions\\.","errorType":"http","errorClass":"RepomixError","httpStatus":404,"severity":"error","filePath":"src/core/git/gitHubArchiveApi.ts","lineNumber":42,"sourceCode":"  }\n\n  return `https://codeload.github.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/tar.gz/master`;\n};\n\n/**\n * Builds alternative archive URL for tags\n * With codeload.github.com, refs are resolved automatically so tag fallback is no longer needed.\n */\nexport const buildGitHubTagArchiveUrl = (_repoInfo: GitHubRepoInfo): string | null => {\n  return null;\n};\n\n/**\n * Checks if a response indicates a GitHub API rate limit or error\n */\nexport const checkGitHubResponse = (response: Response): void => {\n  if (response.status === 404) {\n    throw new RepomixError(\n      'Repository not found or is private. Please check the repository URL and your access permissions.',\n    );\n  }\n\n  if (response.status === 403) {\n    const rateLimitRemaining = response.headers.get('X-RateLimit-Remaining');\n    if (rateLimitRemaining === '0') {\n      const resetTime = response.headers.get('X-RateLimit-Reset');\n      const resetDate = resetTime ? new Date(Number.parseInt(resetTime, 10) * 1000) : null;\n      throw new RepomixError(\n        `GitHub API rate limit exceeded. ${resetDate ? `Rate limit resets at ${resetDate.toISOString()}` : 'Please try again later.'}`,\n      );\n    }\n    throw new RepomixError(\n      'Access denied. The repository might be private or you might not have permission to access it.',\n    );\n  }\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/git/gitHubArchiveApi.ts#L24-L60","documentation":"checkGitHubResponse maps an HTTP 404 from the GitHub archive/API endpoint to this friendly error. GitHub returns 404 for both nonexistent and private repositories (it does not leak existence), so the message covers both cases.","triggerScenarios":"A GitHub API/archive request returns status 404 — the repository does not exist, the name/owner is misspelled, the repo is private, or the request was made without a token that grants access to a private repo.","commonSituations":"Typo in the owner/repo URL; trying to pack a private repo without a GITHUB_TOKEN; repo renamed or deleted; accessing a repo in an org that requires SSO authorization of your token.","solutions":["Verify the repository URL/owner/repo in a browser and correct any typo.","If the repo is private, set a token: `export GITHUB_TOKEN=ghp_...` (or GH_TOKEN) with read access, and authorize it for SSO if the org requires it.","Confirm the repo still exists (may have been renamed/deleted) and update the URL."],"exampleFix":"// before (private repo, no token)\nnpx repomix --remote https://github.com/myorg/private-repo\n// after\nexport GITHUB_TOKEN=ghp_yourTokenWithRepoScope\nnpx repomix --remote https://github.com/myorg/private-repo","handlingStrategy":"validation","validationCode":"const repoUrl = 'https://github.com/owner/repo';\nconst res = await fetch(repoUrl, { headers: process.env.GITHUB_TOKEN ? { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } : {} });\nif (!res.ok) throw new Error(`Repo inaccessible (${res.status}); check URL spelling or provide a token with access.`);","typeGuard":null,"tryCatchPattern":"try {\n  await pack({ remote: url });\n} catch (e) {\n  if (e instanceof RepomixError && e.message.includes('Repository not found or is private')) {\n    console.error('Verify the repo URL and set GITHUB_TOKEN for private repos.');\n  } else throw e;\n}","preventionTips":["Open the repo URL in a browser (logged in) to confirm it exists and is visible before packing.","Set GITHUB_TOKEN with read access whenever any repo may be private.","Authorize tokens for org SSO and keep them unexpired/rotated.","Copy repo URLs directly from GitHub instead of typing owner/repo by hand."],"tags":["github","http-404","authentication","remote"],"backgroundTag":"repository-not-found","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}