siyuan-note/siyuan · error

Conf.Language(15)

Error message

Conf.Language(15)

What it means

This kernel code looks up a block by ID in a tree and, when the node is missing, fails with fmt.Errorf(Conf.Language(15), id) — a localized "block [id] not found" message. In the accessibility flow surfaced at app/electron/accessibility.js, the Electron main process catches this err value when reading the accessibility override file; a missing file (ENOENT) is treated as 'accessibility not configured' rather than a fatal failure.

Solutions

  1. Verify the block ID exists (e.g. via /api/query/sql or getBlockKramdown) before calling the API
  2. Refresh/reopen the document so client-side references are current
  3. For the accessibility file case, no action needed — ENOENT is handled as a default (disabled) state
Defensive patterns

Strategy: try-catch

Validate before calling

const block = await api.getBlockByID(id);
if (!block) throw new Error(`block ${id} not found; refresh document references`);

Type guard

function blockExists(b) {
  return !!b && typeof b.id === "string" && b.id.length > 0;
}

Try / catch

try {
  const enabled = await getAccessibilityOverride();
} catch (error) {
  if (error.code === "ENOENT") {
    return false; // not configured yet — default state
  }
  throw error;
}

Prevention

When it happens

Trigger: Passing a document/block id that no longer exists (block deleted, doc removed, ID mistyped) to the heading-related API at block.go:863; on the Electron side, the accessibility settings file not existing yet when getAccessibilityOverride reads it.

Common situations: Stale references kept after deleting blocks or notebooks; syncing conflicts removing blocks still referenced elsewhere; first launch before accessibility.js ever wrote its config file.

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@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/f5413cf14af381f4. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/block.go:863

				headingMode = "0"
			}
			embed.SetIALAttr("custom-heading-mode", headingMode)
		}
		embed.AppendChild(&ast.Node{Type: ast.NodeBlockQueryEmbedScript, Tokens: []byte("select * from blocks where id='" + defID + "'")})
		originalRefNode.InsertBefore(embed)
		originalRefNode.Unlink()
	}
}

func GetHeadingDeleteTransaction(id string) (transaction *Transaction, err error) {
	tree, err := LoadTreeByBlockID(id)
	if err != nil {
		return
	}

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

	if ast.NodeHeading != node.Type {
		return
	}

	var nodes []*ast.Node
	nodes = append(nodes, node)
	nodes = append(nodes, treenode.HeadingChildren(node)...)
	hiddenNodes := map[string]bool{}
	for _, hidden := range treenode.CollectFoldHiddenNodes(node.Parent) {
		hiddenNodes[hidden.ID] = true
	}

	transaction = &Transaction{}
	luteEngine := util.NewLute()
	for _, n := range nodes {

View on GitHub (pinned to 9f775e8a12)