{"record":{"id":"5c81d336610db320","repo":"siyuan-note/siyuan","slug":"walk-notebook-assets-s-failed-w","errorCode":null,"errorMessage":"walk notebook assets [%s] failed: %w","messagePattern":"walk notebook assets \\[(.+?)\\] failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/assets.go","lineNumber":2779,"sourceCode":"\t\t\t\t\t\t\treturn filepath.SkipDir\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\trelPath, relErr := assetPathMapKey(assetsDirPath, assetPath, d.IsDir())\n\t\t\t\t\tif relErr != nil {\n\t\t\t\t\t\treturn relErr\n\t\t\t\t\t}\n\t\t\t\t\tassetsAbsPathMap[relPath] = assetPath\n\t\t\t\t\treturn nil\n\t\t\t\t}); nestedWalkErr != nil {\n\t\t\t\t\treturn nestedWalkErr\n\t\t\t\t}\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif walkErr != nil {\n\t\t\treturn nil, fmt.Errorf(\"walk notebook assets [%s] failed: %w\", notebookAbsPath, walkErr)\n\t\t}\n\t}\n\n\t// 全局 assets\n\tdataAssetsAbsPath := util.GetDataAssetsAbsPath()\n\twalkErr := filelock.Walk(dataAssetsAbsPath, func(assetPath string, d fs.DirEntry, walkErr error) error {\n\t\tif walkErr != nil {\n\t\t\treturn walkErr\n\t\t}\n\t\tif dataAssetsAbsPath == assetPath {\n\t\t\treturn nil\n\t\t}\n\n\t\tif isSkipFile(d.Name()) {\n\t\t\tif d.IsDir() {\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\treturn nil","sourceCodeStart":2761,"sourceCodeEnd":2797,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/assets.go#L2761-L2797","documentation":"While building the list of all assets, walking a notebook's assets directory failed. The kernel walks each notebook's assets folder (via filelock.Walk) plus the global data/assets directory; any per-notebook walk error aborts the whole asset listing and is wrapped with the notebook's absolute path for diagnosis.","triggerScenarios":"filelock.Walk on a notebook's assets dir returns an error — permission denied on the directory, the path disappeared mid-walk (sync deleted it), symlink loops, or an underlying filesystem I/O error while enumerating entries.","commonSituations":"Broken or inaccessible notebook folder after a failed sync/restore; permission changes after moving the workspace between machines or users; OneDrive/Dropbox on-demand files erroring during enumeration; corrupted filesystem.","solutions":["Check the reported notebook directory exists and is readable/executable by the SiYuan process","Repair or remove the broken notebook folder (or re-sync the notebook) so the assets directory is accessible","Fix OS-level permissions on the workspace data/notebooks tree","Check kernel logs for the wrapped walkErr to identify the exact failing entry","Exclude the problematic notebook temporarily and re-run the asset listing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import fs from 'fs';\n// verify each notebook assets dir exists and is readable before listing\nconst ok = fs.existsSync(nbAbsPath) && fs.statSync(nbAbsPath).isDirectory();","typeGuard":null,"tryCatchPattern":"try { await getAllAssets() } catch (e) {\n  const m = e.message.match(/walk notebook assets \\\\[(.+?)\\\\]/);\n  if (m) { fixOrExcludeNotebook(m[1]); }\n}","preventionTips":["Keep notebook folders complete after sync/restore operations","Avoid symlinks inside notebook assets directories","Ensure consistent permissions when moving workspaces between machines"],"tags":["filesystem","walk","assets"],"backgroundTag":"directory-not-found","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}