siyuan-note/siyuan · error

source document [%s] is not a sibling of target document [%s

Error message

source document [%s] is not a sibling of target document [%s]

What it means

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.

Source

Thrown at kernel/model/file.go:2677

	}

	FlushTxQueue()
	target := treenode.GetBlockTree(targetID)
	if !isSortableDocument(target) {
		return ret, fmt.Errorf("target document [%s] not found", targetID)
	}
	box := Conf.Box(target.BoxID)
	if nil == box {
		return ret, fmt.Errorf("target document [%s] is not in an opened and unlocked notebook", targetID)
	}
	parentPath := path.Dir(target.Path)
	for _, sourceID := range sourceIDs {
		source := treenode.GetBlockTree(sourceID)
		if !isSortableDocument(source) {
			return ret, fmt.Errorf("source document [%s] not found", sourceID)
		}
		if source.BoxID != target.BoxID || path.Dir(source.Path) != parentPath {
			return ret, fmt.Errorf("source document [%s] is not a sibling of target document [%s]", sourceID, targetID)
		}
	}

	fileTreeSortLock.Lock()
	confPath := filepath.Join(util.DataDir, box.ID, ".siyuan", "sort.json")
	fullSortIDs, readErr := readSortConfMap(confPath)
	if nil != readErr {
		fileTreeSortLock.Unlock()
		return ret, readErr
	}
	currentIDs, loadErr := loadSiblingCustomOrder(box.ID, parentPath, fullSortIDs)
	if nil != loadErr {
		fileTreeSortLock.Unlock()
		return ret, loadErr
	}
	orderedIDs, changed, reorderErr := reorderIDSequence(currentIDs, sourceIDs, targetID, position)
	if nil != reorderErr || !changed {
		fileTreeSortLock.Unlock()

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Use move (change path) instead of reorder for cross-parent/cross-notebook relocations
  2. Re-select sources from the same parent as the target
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at kernel/model/file.go:2677 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/8deb5fb6163a6882. Report an issue: GitHub.