{"record":{"id":"8deb5fb6163a6882","repo":"siyuan-note/siyuan","slug":"source-document-s-is-not-a-sibling-of-target-do","errorCode":null,"errorMessage":"source document [%s] is not a sibling of target document [%s]","messagePattern":"source document \\[(.+?)\\] is not a sibling of target document \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/file.go","lineNumber":2677,"sourceCode":"\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\n\t}\n\tcurrentIDs, loadErr := loadSiblingCustomOrder(box.ID, parentPath, fullSortIDs)\n\tif nil != loadErr {\n\t\tfileTreeSortLock.Unlock()\n\t\treturn ret, loadErr\n\t}\n\torderedIDs, changed, reorderErr := reorderIDSequence(currentIDs, sourceIDs, targetID, position)\n\tif nil != reorderErr || !changed {\n\t\tfileTreeSortLock.Unlock()","sourceCodeStart":2659,"sourceCodeEnd":2695,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/file.go#L2659-L2695","documentation":"ReorderDocs sibling guard: a source document resolves, but lives in a different notebook or a different parent path than the target. Relative reorder is only defined between siblings of the same parent document.","triggerScenarios":"Thrown at kernel/model/file.go:2677 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use move (change path) instead of reorder for cross-parent/cross-notebook relocations","Re-select sources from the same parent as the target"],"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-14T00:17:10.932Z"}