{"record":{"id":"f9837591ca197ead","repo":"infiniflow/ragflow","slug":"skills-space-not-found","errorCode":null,"errorMessage":"Skills space not found","messagePattern":"Skills space not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/src/pages/skills/hooks.ts","lineNumber":773,"sourceCode":"        // Filter out ignored/junk files first\n        const filteredFiles = filterUploadFiles(files);\n\n        // Validate skill format\n        const validation = await validateSkillFormatImpl(filteredFiles);\n        if (!validation.valid) {\n          const errorKey = `skills.validation.${validation.error}`;\n          const errorMsg = t(errorKey) || t('skills.validation.invalid');\n          message.error(errorMsg);\n          return false;\n        }\n\n        // Get space folder ID (using space name for file system)\n        const spaceFolderId = await ensureSkillSpaceFolder(\n          normalizedSpaceName,\n          true,\n        );\n\n        if (!spaceFolderId) throw new Error('Skills space not found');\n\n        const skillNameNormalized = name.replace(/\\s+/g, '-').toLowerCase();\n\n        // Check if skill folder exists\n        const { data: existingData } = await fileManagerService.listFile({\n          parent_id: spaceFolderId,\n        });\n\n        let skillFolderId: string;\n\n        if (existingData.code === 0) {\n          const existingSkill = existingData.data?.files?.find(\n            (f: any) => f.name === skillNameNormalized && f.type === 'folder',\n          );\n\n          if (existingSkill) {\n            // Skill exists, check if version already exists\n            const { data: versionData } = await fileManagerService.listFile({","sourceCodeStart":755,"sourceCodeEnd":791,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/web/src/pages/skills/hooks.ts#L755-L791","documentation":"Thrown in web/src/pages/skills/hooks.ts:773 when ensureSkillSpaceFolder(normalizedSpaceName, true) returns a falsy folder id. That helper looks up (or creates) the root file-manager folder for the skills space; a falsy return means the folder could not be found nor created — e.g. the file-manager API failed, returned code !== 0, or gave a response without an id.","triggerScenarios":"The file-manager list/create-folder API call failed (auth expired, backend down); the space folder exists in the file manager but under a differently normalized name so lookup misses and creation is rejected; backend returned code 0 but omitted data.id; ensureSkillSpaceFolder swallows an exception and returns undefined.","commonSituations":"First upload to a new space where folder auto-creation fails silently. Name normalization mismatch (trailing spaces, case) between lookup and creation. Backend file-manager service not initialized.","solutions":["Inspect ensureSkillSpaceFolder's internals: log which call (list vs create) failed and the response code","Verify the file-manager service is healthy and authenticated (list root folders via UI)","Check that normalizedSpaceName matches the actual folder name in the file manager","Have ensureSkillSpaceFolder throw its own descriptive error instead of returning falsy","Retry the upload after re-login if the token expired"],"exampleFix":"// before\nconst spaceFolderId = await ensureSkillSpaceFolder(\n  normalizedSpaceName,\n  true,\n);\nif (!spaceFolderId) throw new Error('Skills space not found');\n\n// after\nconst spaceFolderId = await ensureSkillSpaceFolder(\n  normalizedSpaceName,\n  true,\n);\nif (!spaceFolderId) {\n  message.error(t('skills.errors.spaceFolderUnavailable'));\n  return false;\n}","handlingStrategy":"try-catch","validationCode":"const spaceFolderExists = async (name: string) => {\n  const { data } = await fileManagerService.listFile({ parent_id: ROOT });\n  return (data.data?.files || []).some((f) => f.name === name.trim());\n};","typeGuard":"const isFolderId = (v: unknown): v is string =>\n  typeof v === 'string' && v.length > 0;","tryCatchPattern":"try {\n  const id = await ensureSkillSpaceFolder(name, true);\n  if (!id) throw new Error('space folder unavailable');\n} catch (e) {\n  message.error(e.message);\n  return false;\n}","preventionTips":["Have ensureSkillSpaceFolder throw detailed errors instead of returning falsy","Verify the file-manager service responds (list root) before starting uploads"],"tags":["skills","file-manager","upload","space"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}