siyuan-note/siyuan · error

source document [%s] not found

Error message

source document [%s] not found

What it means

ReorderDocs source guard: one of the source block-tree entries is missing or not a sortable document. A source ID that was deleted, is not a document, or is otherwise unsortable aborts the whole reorder batch.

Source

Thrown at kernel/model/file.go:2674

	ret = &ReorderResult{}
	if err = validateReorderArgs(sourceIDs, targetID, position); nil != err {
		return
	}

	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
	}

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Refresh the doc tree so source IDs still exist
  2. Filter out deleted source documents before reordering
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at kernel/model/file.go:2674 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/c3d5cd5ed408c78a. Report an issue: GitHub.