siyuan-note/siyuan · error
Conf.Language(16)
Error message
Conf.Language(16)
What it means
validateCreateDoc derives the new doc's ID-bearing basename from the requested path via strings.TrimSpace(path.Base(p)) and runs util.GetTreeID on it. If that yields an empty string the path is not a usable document path, and the kernel returns errors.New(Conf.Language(16)) — literally the string "Untitled" — as the error. Practically it means the client passed a path whose basename cannot carry a doc ID (e.g. empty path or a bare '/').
Solutions
- Pass a well-formed path ending in a valid doc-ID basename, e.g. '/20240101120000-abcdefg' (parent doc path) — the kernel then generates the child ID.
- If you have no parent, create the doc at the notebook root with path set to a newly generated ID via /api/filetree/createDocWithMd or generate an ID client-side.
- Check for empty/undefined path values in the calling code before the request.
- Use /api/filetree/getDocTree to pick a real parent path.
Example fix
// before
await fetchPost("/api/filetree/createDoc", { notebook, path: parentPath || "", title });
// after
const p = parentPath || "/" + newDocID(); // valid '<yyMMddHHmmss>-<rand>' basename
await fetchPost("/api/filetree/createDoc", { notebook, path: p, title }); Defensive patterns
Strategy: validation
Validate before calling
function hasValidDocBasename(p) {
const base = p.split("/").filter(Boolean).pop() || "";
return /^\d{14}-[a-z0-9]{7}$/.test(base);
}
if (!hasValidDocBasename(p)) throw new Error("path needs a valid doc-ID basename"); Prevention
- Never pass an empty or root-only path to createDoc.
- Verify parentPath is defined before building the request path.
- Pick parent paths from the doc tree API rather than manual strings.
When it happens
Trigger: Calling /api/filetree/createDoc with an empty or root-only path value ('' or '/'); a client that builds the path by joining an empty parent ID with the title; passing a path missing the required <timestamp>-<random> ID segment format.
Common situations: Plugin code where parentPath is undefined/empty and string concatenation produced '/'; API scripts testing createDoc with minimal params and omitting path; UI state where the selected parent doc ID was not yet loaded.
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
- Untitled
- block [ ] is not a document that can declare a child…
- Cannot create a file starting with .
- Conf.Language(1)
- Conf.Language(106)
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/dbaea746d46f6e27.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/file.go:2306
func validateCreateDoc(boxID, p, title string, titleEmpty bool) (ret *createDocValidation, err error) {
p = normalizeBoxDocPath(boxID, p)
title = normalizeDocTitle(title)
if 512 < utf8.RuneCountInString(title) {
// 限制笔记本名和文档名最大长度为 `512` https://github.com/siyuan-note/siyuan/issues/6299
return nil, errors.New(Conf.Language(106))
}
isEmpty := false
if "" == title {
title = Conf.Language(16)
isEmpty = true
} else if titleEmpty {
isEmpty = true
}
baseName := strings.TrimSpace(path.Base(p))
if "" == util.GetTreeID(baseName) {
return nil, errors.New(Conf.Language(16))
}
if strings.HasPrefix(baseName, ".") {
return nil, errors.New(Conf.Language(13))
}
box, boxErr := getOpenedBox(boxID)
if nil != boxErr {
return nil, boxErr
}
folder := path.Dir(p)
hPath := "/" + title
if "/" != folder {
parentID := path.Base(folder)
parentTree, loadErr := LoadTreeByBlockID(parentID)
if nil != loadErr {
logging.LogErrorf("get parent tree [%s] failed", parentID)
return nil, ErrBlockNotFoundView on GitHub (pinned to 9f775e8a12)