siyuan-note/siyuan · error
The current settings do not allow the creation of…
Error message
The current settings do not allow the creation of sub-documents under a document 7 levels deep
What it means
Thrown by MoveDocs (kernel/model/file.go:1776) during the depth pre-check. For each moved path it computes childDepth = util.GetChildDocDepth() (the deepest descendant level relative to the moved doc, scanned on disk) and adds strings.Count(toPath, "/") (the target's level). If the sum exceeds 6 and the setting Conf.FileTree.AllowCreateDeeper is false, the move aborts with Conf.Language(118) — the resulting hierarchy would place sub-documents more than 7 levels deep. This mirrors the create-time limit and exists because deep trees degrade listing and indexing performance.
Solutions
- Enable 设置 - 文档树 - 允许创建深度超过 7 层的子文档 (Settings - Filetree - Allow creation of sub-documents deeper than 7 levels), then retry the move
- Move the branch to a shallower target (closer to the notebook root) so targetDepth + subtreeDepth <= 6
- Split the move: relocate ancestors first, or move deep sub-trees independently to keep each resulting depth within the limit
- For API callers, read the setting via /api/setting/getFileTree and warn the user before attempting a deep move
Example fix
// before
fetchPost('/api/filetree/moveDocs', {fromPaths: [deepBranch], toNotebook, toPath: level6ParentPath}) // 400: 7-level limit
// after
// either raise the target or lift the limit
const conf = await fetchSyncPost('/api/setting/getFileTree', {})
if (!conf.data.fileTree.allowCreateDeeper) {
await fetchSyncPost('/api/setting/setFileTree', {fileTree: {...conf.data.fileTree, allowCreateDeeper: true}})
}
fetchPost('/api/filetree/moveDocs', {fromPaths: [deepBranch], toNotebook, toPath: level6ParentPath}) Defensive patterns
Strategy: validation
Validate before calling
// Pre-check the move depth budget like the kernel does (file.go:1772-1778)
func moveDepthOK(fromBoxID, fromPath, toPath string) bool {
if Conf.FileTree.AllowCreateDeeper {
return true
}
childDepth := util.GetChildDocDepth(filepath.Join(util.DataDir, fromBoxID, fromPath))
return strings.Count(toPath, "/")+childDepth <= 6
} Prevention
- Expose and honor the allowCreateDeeper setting in your tooling; warn before deep moves instead of failing mid-batch
- When reorganizing, move branches upward (toward root) rather than deeper to stay within budget
- Remember the budget counts the subtree's deepest child, not just the dragged doc
When it happens
Trigger: POST /api/filetree/moveDocs that drops a document which has descendants (e.g. a 4-level subtree) under a parent already at level 5+, so target depth + subtree depth > 6; always fires before any file operation, so nothing is moved. Conf.FileTree.AllowCreateDeeper (Settings - Filetree - "Allow creation of sub-documents deeper than 7 levels") being disabled is the enabling condition.
Common situations: Reorganizing a deep knowledge base by dragging whole branches toward the bottom of the tree; importing structured content then trying to nest it; orgs that disabled the deep-hierarchy toggle to keep trees flat.
Related errors
- The top-level notebook document cannot be removed or moved
- Conf.Language(118)
- Conf.Language(118)
- filter nesting depth exceeds the maximum allowed
- Move notebook [ ] file [ ] failed
AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18).
Data as JSON: /api/errors/1a94f4d149ea5d84.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/file.go:1776
}
}
if 1 == len(fromPaths) {
// 移动到自己的父文档下的情况相当于不移动,直接返回
if fromBox := pathsBoxes[fromPaths[0]]; nil != fromBox && fromBox.ID == toBoxID {
parentDir := path.Dir(fromPaths[0])
if ("/" == toPath && "/" == parentDir) || (parentDir+".sy" == toPath) {
return
}
}
}
// 检查路径深度是否超过限制
for _, fromPath := range fromPaths {
fromBox := pathsBoxes[fromPath]
childDepth := util.GetChildDocDepth(filepath.Join(util.DataDir, fromBox.ID, fromPath))
if depth := strings.Count(toPath, "/") + childDepth; 6 < depth && !Conf.FileTree.AllowCreateDeeper {
err = errors.New(Conf.Language(118))
return
}
}
// 禁止跨加密边界移动文档:加密笔记本是孤岛,不同加密笔记本各有独立 DEK,
// 跨边界移动(普通↔加密、加密 A↔加密 B)会导致密文用错 DEK 损坏数据
for _, fromPath := range fromPaths {
fromBox := pathsBoxes[fromPath]
if fromBox.ID != toBox.ID && !IsSameCryptoBoundary(fromBox.ID, toBox.ID) {
err = errors.New(Conf.Language(313))
return
}
}
// A progress layer appears when moving more than 64 documents at once https://github.com/siyuan-note/siyuan/issues/9356
subDocsCount := 0
for _, fromPath := range fromPaths {
fromBox := pathsBoxes[fromPath]View on GitHub (pinned to afa823b6b4)