{"record":{"id":"f9f410720dc03797","repo":"infiniflow/ragflow","slug":"repository-or-path-not-found-please-check-the-url","errorCode":null,"errorMessage":"Repository or path not found. Please check the URL and ensure the repository is public.","messagePattern":"Repository or path not found\\. Please check the URL and ensure the repository is public\\.","errorType":"http","errorClass":"Error","httpStatus":404,"severity":"error","filePath":"web/src/pages/skills/components/upload-modal.tsx","lineNumber":388,"sourceCode":"        if (token) {\n          url += `&access_token=${token}`;\n        }\n      }\n\n      const response = await fetch(url, { headers });\n\n      if (!response.ok) {\n        const errorData = await response.json().catch(() => ({}));\n        const message = errorData.message || `HTTP ${response.status}`;\n\n        if (response.status === 403) {\n          const limit = platform === 'github' ? '60' : '1000';\n          throw new Error(\n            `API rate limit exceeded. ${limit} requests/hour for unauthenticated requests.`,\n          );\n        }\n        if (response.status === 404) {\n          throw new Error(\n            'Repository or path not found. Please check the URL and ensure the repository is public.',\n          );\n        }\n        throw new Error(`Failed to fetch: ${message}`);\n      }\n\n      const items = await response.json();\n      const files: GitFile[] = [];\n\n      // Handle single file case\n      if (!Array.isArray(items)) {\n        if (items.type === 'file') {\n          files.push({\n            path: items.path,\n            download_url: items.download_url,\n            type: 'file',\n            size: items.size,\n          });","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/web/src/pages/skills/components/upload-modal.tsx#L370-L406","documentation":"Raised by the skill upload modal when the GitHub/Gitee contents API responds with HTTP 404 — the owner/repo/path/ref combination does not exist (or is not visible without authentication). The URL was syntactically parseable but points to nothing accessible.","triggerScenarios":"Typo in owner or repo name; the ref (branch/tag/sha) does not exist (common when defaulting to a branch like 'main' vs 'master'); the path does not exist in the repo at that ref; the repo is private and no token was given (GitHub returns 404, not 403, for private repos).","commonSituations":"Importing a repo whose default branch is 'master' while the importer assumes 'main'; referencing a subfolder that was renamed; URL pasted with a trailing period or extra path segment; private repo without token.","solutions":["Open the URL in a browser to verify owner/repo/branch/path all exist and are public","Explicitly include the correct branch in the URL (e.g. tree/master) if the default branch is not 'main'","For private repos, supply an access token in the modal's token field","Double-check for typo'd path segments or stale links from documentation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function normalizeGitUrl(raw: string): string | null {\n  try {\n    const u = new URL(raw.trim());\n    if (!/(^|\\.)github\\.com$|(^|\\.)gitee\\.com$/.test(u.hostname)) return null;\n    const parts = u.pathname.replace(/\\.git$/, '').split('/').filter(Boolean);\n    if (parts.length < 2) return null;\n    return u.origin + '/' + parts.join('/');\n  } catch {\n    return null;\n  }\n}\n\nconst normalized = normalizeGitUrl(repoUrl);\nif (!normalized) showUrlError();","typeGuard":"function isGitRepoUrl(v: string, platform: 'github' | 'gitee'): v is string {\n  try {\n    const u = new URL(v);\n    return u.hostname.endsWith(`${platform}.com`) &&\n      u.pathname.split('/').filter(Boolean).length >= 2;\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"try {\n  const files = await fetchGitDirectoryContents(platform, owner, repo, path, ref, token);\n} catch (e) {\n  const msg = e instanceof Error ? e.message : String(e);\n  if (msg.includes('not found')) {\n    setGitValidationStatus('invalid');\n    setGitValidationMessage('Check the URL, branch, and that the repo is public.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Verify the URL opens in a browser before importing","Include the exact branch in the URL when the default branch is not 'main'","Provide a token when importing private repos (GitHub returns 404 for invisible repos)"],"tags":["github-api","not-found","url","skills","network"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}