{"record":{"id":"9cf4a20c4501436f","repo":"siyuan-note/siyuan","slug":"create-conf-dir-failed-w","errorCode":null,"errorMessage":"create conf dir failed: %w","messagePattern":"create conf dir failed: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/file.go","lineNumber":3088,"sourceCode":"\nfunc (box *Box) addMaxSort(parentPath, id string) {\n\tif err := box.placeDocInSiblingOrder(parentPath, id, \"\", \"after\"); nil != err {\n\t\tlogging.LogErrorf(\"append document sort failed: %s\", err)\n\t}\n}\n\nfunc (box *Box) addMinSort(parentPath, id string) {\n\tif err := box.placeDocInSiblingOrder(parentPath, id, \"\", \"before\"); nil != err {\n\t\tlogging.LogErrorf(\"prepend document sort failed: %s\", err)\n\t}\n}\n\nfunc (box *Box) placeDocInSiblingOrder(parentPath, id, targetID, position string) error {\n\tfileTreeSortLock.Lock()\n\tconfDir := filepath.Join(util.DataDir, box.ID, \".siyuan\")\n\tif err := os.MkdirAll(confDir, 0755); nil != err {\n\t\tfileTreeSortLock.Unlock()\n\t\treturn fmt.Errorf(\"create conf dir failed: %w\", err)\n\t}\n\tconfPath := filepath.Join(confDir, \"sort.json\")\n\tfullSortIDs, err := readSortConfMap(confPath)\n\tif nil != err {\n\t\tfileTreeSortLock.Unlock()\n\t\treturn err\n\t}\n\tcurrentIDs, err := loadSiblingCustomOrder(box.ID, parentPath, fullSortIDs)\n\tif nil != err {\n\t\tfileTreeSortLock.Unlock()\n\t\treturn err\n\t}\n\torderedIDs := make([]string, 0, len(currentIDs)+1)\n\tfor _, currentID := range currentIDs {\n\t\tif currentID != id {\n\t\t\torderedIDs = append(orderedIDs, currentID)\n\t\t}\n\t}","sourceCodeStart":3070,"sourceCodeEnd":3106,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/file.go#L3070-L3106","documentation":"placeDocInSiblingOrder persists per-notebook custom sort order into <data>/<box>/.siyuan/sort.json. It wraps any os.MkdirAll failure of the .siyuan config directory with this message. This is a filesystem I/O failure, not a logical error — the sort cannot be saved.","triggerScenarios":"os.MkdirAll(util.DataDir/<boxID>/.siyuan, 0755) fails while inserting a document into sibling custom order — e.g. data directory missing, disk full, permissions changed, path owned by another user, or the notebook directory was deleted concurrently.","commonSituations":"Read-only volume or network drive disconnected; running SiYuan under a different user than the data dir owner; antivirus blocking directory creation; disk quota exceeded.","solutions":["Check filesystem permissions on <data>/<boxID>/ and ensure the kernel process user can create directories there","Free disk space / resolve disk-quota exhaustion and retry","Verify the notebook directory still exists under the data directory; if not, re-open the notebook","Check for a read-only mount or disconnected network storage holding the workspace"],"exampleFix":"// inspect the wrapped cause before retrying\nls -ld ~/SiYuan/data/<boxID>\nmkdir -p ~/SiYuan/data/<boxID>/.siyuan  # reproduce the EACCES/ENOSPC manually","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := placeDocInSiblingOrder(...)\nif err != nil && strings.Contains(err.Error(), \"create conf dir failed\") {\n    // inspect wrapped cause: errors.Unwrap, check disk/permissions, retry once\n}","preventionTips":["Keep the workspace on a writable, always-mounted volume","Monitor free disk space before write-heavy operations","Run the kernel under the same user that owns the data directory"],"tags":["filesystem","mkdir","permissions","sorting"],"backgroundTag":"mkdir-permission-denied","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"}