siyuan-note/siyuan · error

Conf.Language(15) formatted with block id (localized block-n

Error message

Conf.Language(15) formatted with block id (localized block-not-found message)

What it means

After locating the tree for the given block id, SetBlockReminder calls treenode.GetNodeInTree and throws this error when no node with that id exists in the tree. The message is the localized block-not-found template (key 15) with the offending id interpolated, so the user sees which block was not found.

Source

Thrown at kernel/model/blockial.go:100

	if "0" != timed {
		t, e := dateparse.ParseIn(timed, time.Now().Location())
		if nil != e {
			return e
		}
		timedMills = t.UnixMilli()
	}

	FlushTxQueue()

	attrs := sql.GetBlockAttrs(id)
	tree, err := LoadTreeByBlockID(id)
	if err != nil {
		return
	}

	node := treenode.GetNodeInTree(tree, id)
	if nil == node {
		return fmt.Errorf(Conf.Language(15), id)
	}

	if ast.NodeDocument != node.Type && node.IsContainerBlock() {
		node = treenode.FirstLeafBlock(node)
	}

	content := sql.NodeStaticContent(node, nil, false, false, false)
	content = gulu.Str.SubStr(content, 128)
	content = strings.ReplaceAll(content, editor.Zwsp, "")
	err = SetCloudBlockReminder(id, content, timedMills)
	if err != nil {
		return
	}

	attrName := "custom-reminder-wechat"
	if "0" == timed {
		delete(attrs, attrName)
		old := node.IALAttr(attrName)

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Re-fetch the block id (e.g. via /api/filetree/getDoc) and retry with a valid id
  2. Verify the block still exists — if deleted, recreate it before setting a reminder
  3. Confirm the id belongs to a notebook currently present in the workspace (not renamed/deleted box)

Example fix

// before
SetBlockReminder("dead-id", "2024-06-01 09:00") // Conf.Language(15) formatted with "dead-id"
// after
node := treenode.GetNodeInTree(tree, "20240101120000-abc")
if node != nil { SetBlockReminder("20240101120000-abc", "2024-06-01 09:00") }
Defensive patterns

Strategy: validation

Validate before calling

// Go: verify the node exists before setting a reminder
if tree, err := model.LoadTree(box, path); err == nil {
    if treenode.GetNodeInTree(tree, id) == nil {
        return errors.New("block not found: " + id)
    }
}
// TS: fetch block info first
const info = await fetchPost("/api/block/getBlockInfo", { id });
if (!info.code === 0) throw new Error("block missing");

Type guard

func blockExists(box, path, id string) bool {
    tree, err := model.LoadTree(box, path)
    return err == nil && treenode.GetNodeInTree(tree, id) != nil
}

Prevention

When it happens

Trigger: Calling SetBlockReminder with an id that does not resolve to a node in the loaded tree: deleted block, mistyped id, id from a different notebook, or tree load failure swallowed by the earlier error return.

Common situations: Frontend holds a stale block id after the block was deleted or the doc re-indexed; API scripts using hand-copied ids; reminders set on a block in a closed/unloaded notebook.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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