siyuan-note/siyuan · error

target document [%s] not found

Error message

target document [%s] not found

What it means

ReorderDocs target guard: the target block-tree entry is missing or not a sortable document (isSortableDocument false — deleted, non-document, or non-sortable). The drag target for the document reorder cannot be used.

Source

Thrown at kernel/model/file.go:2664

// ReorderResult 描述相对排序操作的结果。
type ReorderResult struct {
	Changed    bool   `json:"changed"`
	Notebook   string `json:"notebook,omitempty"`
	ParentPath string `json:"parentPath,omitempty"`
}

// ReorderDocs 将同级文档移动到目标文档之前或之后。
func ReorderDocs(sourceIDs []string, targetID, position string) (ret *ReorderResult, err error) {
	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")

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Refresh the doc tree UI so the target still exists
  2. Verify targetID is a document block, not a content block
Defensive patterns

Strategy: validation

When it happens

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