{"record":{"id":"8eeddeea6e85abc5","repo":"siyuan-note/siyuan","slug":"target-document-s-is-not-in-an-opened-and-unloc","errorCode":null,"errorMessage":"target document [%s] is not in an opened and unlocked notebook","messagePattern":"target document \\[(.+?)\\] is not in an opened and unlocked notebook","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/file.go","lineNumber":2668,"sourceCode":"\tNotebook   string `json:\"notebook,omitempty\"`\n\tParentPath string `json:\"parentPath,omitempty\"`\n}\n\n// ReorderDocs 将同级文档移动到目标文档之前或之后。\nfunc ReorderDocs(sourceIDs []string, targetID, position string) (ret *ReorderResult, err error) {\n\tret = &ReorderResult{}\n\tif err = validateReorderArgs(sourceIDs, targetID, position); nil != err {\n\t\treturn\n\t}\n\n\tFlushTxQueue()\n\ttarget := treenode.GetBlockTree(targetID)\n\tif !isSortableDocument(target) {\n\t\treturn ret, fmt.Errorf(\"target document [%s] not found\", targetID)\n\t}\n\tbox := Conf.Box(target.BoxID)\n\tif nil == box {\n\t\treturn ret, fmt.Errorf(\"target document [%s] is not in an opened and unlocked notebook\", targetID)\n\t}\n\tparentPath := path.Dir(target.Path)\n\tfor _, sourceID := range sourceIDs {\n\t\tsource := treenode.GetBlockTree(sourceID)\n\t\tif !isSortableDocument(source) {\n\t\t\treturn ret, fmt.Errorf(\"source document [%s] not found\", sourceID)\n\t\t}\n\t\tif source.BoxID != target.BoxID || path.Dir(source.Path) != parentPath {\n\t\t\treturn ret, fmt.Errorf(\"source document [%s] is not a sibling of target document [%s]\", sourceID, targetID)\n\t\t}\n\t}\n\n\tfileTreeSortLock.Lock()\n\tconfPath := filepath.Join(util.DataDir, box.ID, \".siyuan\", \"sort.json\")\n\tfullSortIDs, readErr := readSortConfMap(confPath)\n\tif nil != readErr {\n\t\tfileTreeSortLock.Unlock()\n\t\treturn ret, readErr","sourceCodeStart":2650,"sourceCodeEnd":2686,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/file.go#L2650-L2686","documentation":"ReorderDocs notebook guard: the target document exists, but Conf.Box(target.BoxID) returned nil — its notebook is closed, nonexistent, or currently locked (encrypted and not unlocked). Reordering requires an opened, writable notebook.","triggerScenarios":"Thrown at kernel/model/file.go:2668 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the target notebook in the notebook list","Unlock the encrypted notebook before reordering","Retry the drag after the notebook is available"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}