{"record":{"id":"f8d6715944244bbc","repo":"infiniflow/ragflow","slug":"invalid-platform-config-gitplatform-name-url-f","errorCode":null,"errorMessage":"Invalid ${PLATFORM_CONFIG[gitPlatform].name} URL format","messagePattern":"Invalid (.+?) URL format","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/src/pages/skills/components/upload-modal.tsx","lineNumber":570,"sourceCode":"\n    if (!validateGitVersion(gitVersion)) {\n      setGitValidationStatus('invalid');\n      setGitValidationMessage(\n        t('skills.versionFormatHelp') ||\n          'Version must be in semver format (e.g., 1.0.0)',\n      );\n      return;\n    }\n\n    setGitImporting(true);\n    setGitProgress('Parsing repository URL...');\n    setGitValidationStatus(null);\n    setGitValidationMessage('');\n\n    try {\n      const parsed = parseGitUrl(repoUrl, gitPlatform);\n      if (!parsed) {\n        throw new Error(\n          `Invalid ${PLATFORM_CONFIG[gitPlatform].name} URL format`,\n        );\n      }\n\n      const { owner, repo, ref, path } = parsed;\n\n      // 1. Fetch file list from Git API\n      setGitProgress('Fetching file list...');\n      const gitFiles = await fetchGitDirectoryContents(\n        gitPlatform,\n        owner,\n        repo,\n        path,\n        ref,\n        gitToken || undefined,\n      );\n\n      if (gitFiles.length === 0) {","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/web/src/pages/skills/components/upload-modal.tsx#L552-L588","documentation":"Raised at the start of the git import flow when parseGitUrl cannot extract owner/repo/ref/path from the entered URL for the selected platform. The URL does not match the expected github.com/gitee.com repository URL patterns (e.g. https://host/owner/repo/tree/ref/path).","triggerScenarios":"Pasting an SSH URL (git@github.com:owner/repo.git), a URL with www or a different host, a bare 'owner/repo' shorthand, a URL for a platform different from the selected gitPlatform toggle, or extra segments that break the regex.","commonSituations":"Copying the clone URL instead of the browser URL; platform toggle set to 'gitee' while pasting a GitHub link; trailing '.git' suffix or query params (?tab=readme) not handled by the parser.","solutions":["Use the full HTTPS web URL of the repository or folder, e.g. https://github.com/owner/repo/tree/main/skills","Make sure the platform selector matches the URL's host","Remove .git suffix, query strings, and fragments from the pasted URL","If SSH-style input should be supported, extend parseGitUrl with that pattern"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function parseGitUrlSafe(url: string, platform: 'github' | 'gitee') {\n  try {\n    const u = new URL(url.trim());\n    if (!u.hostname.endsWith(`${platform}.com`)) return null;\n    const segs = u.pathname.replace(/\\.git$/, '').split('/').filter(Boolean);\n    if (segs.length < 2) return null;\n    return {\n      owner: segs[0],\n      repo: segs[1],\n      ref: segs[2] === 'tree' || segs[2] === 'blob' ? segs[3] ?? 'HEAD' : 'HEAD',\n      path: segs[2] === 'tree' ? segs.slice(4).join('/') : '',\n    };\n  } catch {\n    return null;\n  }\n}\n\nconst parsed = parseGitUrlSafe(repoUrl, gitPlatform);\nif (!parsed) setGitValidationMessage('Use https://{platform}.com/owner/repo[/tree/branch/path]');","typeGuard":"function isSupportedGitUrl(v: string): v is string {\n  try {\n    const u = new URL(v);\n    return /(\\.|^)(github|gitee)\\.com$/.test(u.hostname);\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"try {\n  const parsed = parseGitUrl(repoUrl, gitPlatform);\n  if (!parsed) throw new Error(`Invalid ${PLATFORM_CONFIG[gitPlatform].name} URL format`);\n} catch (e) {\n  setGitValidationStatus('invalid');\n  setGitValidationMessage(e instanceof Error ? e.message : String(e));\n  return; // keep modal open so the user can fix the URL\n}","preventionTips":["Paste the browser URL of the repo/folder, not the SSH clone URL","Keep the platform toggle consistent with the URL host","Strip .git suffixes and query strings before parsing"],"tags":["url-parsing","validation","github","gitee","skills"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}