{"record":{"id":"3727aec44ccc9fef","repo":"infiniflow/ragflow","slug":"failed-to-list-skills-folder","errorCode":null,"errorMessage":"Failed to list skills folder","messagePattern":"Failed to list skills folder","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/src/pages/skills/hooks.ts","lineNumber":824,"sourceCode":"            }\n\n            skillFolderId = existingSkill.id;\n          } else {\n            // Create skill folder\n            const folderRes = await fileManagerService.createFolder({\n              name: skillNameNormalized,\n              type: 'folder',\n              parent_id: spaceFolderId,\n            });\n\n            if (folderRes.data.code !== 0) {\n              throw new Error('Failed to create skill folder');\n            }\n\n            skillFolderId = folderRes.data.data?.id;\n          }\n        } else {\n          throw new Error('Failed to list skills folder');\n        }\n\n        if (!skillFolderId) throw new Error('Failed to get skill folder ID');\n\n        // Create version folder\n        const versionRes = await fileManagerService.createFolder({\n          name: version,\n          type: 'folder',\n          parent_id: skillFolderId,\n        });\n\n        if (versionRes.data.code !== 0) {\n          throw new Error('Failed to create version folder');\n        }\n\n        const versionFolderId = versionRes.data.data?.id;\n\n        if (!versionFolderId)","sourceCodeStart":806,"sourceCodeEnd":842,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/web/src/pages/skills/hooks.ts#L806-L842","documentation":"Thrown in web/src/pages/skills/hooks.ts:824 when the initial fileManagerService.listFile({ parent_id: spaceFolderId }) call — used to check whether the skill folder already exists — resolves with code !== 0. The existence check itself failed, so the code cannot decide between reuse and creation and aborts before creating anything.","triggerScenarios":"spaceFolderId points to a deleted or inaccessible folder; auth token expired between the space-folder step and the listing; backend file-manager error (DB hiccup); parent_id sent as undefined because ensureSkillSpaceFolder returned an id-shaped falsy value earlier.","commonSituations":"Space folder deleted by another session between upload steps. Long upload dialog left open past token expiry. Backend restart mid-flow.","solutions":["Include listData code/message in the thrown error for diagnosis","Re-resolve the space folder (ensureSkillSpaceFolder) and retry the list once before failing","Verify spaceFolderId is a non-empty string before use","Re-authenticate and retry the upload from scratch if the code indicates auth failure"],"exampleFix":"// before\n} else {\n  throw new Error('Failed to list skills folder');\n}\n\n// after\n} else {\n  throw new Error(\n    `[${existingData.code}] ${existingData.message || 'Failed to list skills folder'}`,\n  );\n}","handlingStrategy":"retry","validationCode":"const isParentValid = async (parentId: string) =>\n  (await fileManagerService.listFile({ parent_id: parentId })).data.code === 0;","typeGuard":null,"tryCatchPattern":"try {\n  const { data } = await fileManagerService.listFile({ parent_id });\n  if (data.code !== 0) throw new Error(data.message);\n} catch (e) {\n  await backoffRetry(); // transient backend error\n}","preventionTips":["Re-resolve the space folder immediately before the listing instead of reusing a stale id","Include code and message in the error to distinguish auth vs missing-parent failures"],"tags":["skills","file-manager","upload","api-contract"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}