{"record":{"id":"ca5187bb8c36866f","repo":"siyuan-note/siyuan","slug":"conf-language-5-formatted-with-box-name-path-and-error","errorCode":null,"errorMessage":"Conf.Language(5) formatted with box name, path and error","messagePattern":"Conf\\.Language\\(5\\) formatted with box name, path and error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/file.go","lineNumber":1911,"sourceCode":"\tneedMoveSubDocs := fromBox.Exist(fromFolder)\n\tif needMoveSubDocs {\n\t\t// 移动子文档文件夹\n\n\t\tnewFolder := path.Join(toFolder, tree.ID)\n\t\tif isSameBox {\n\t\t\tif err = fromBox.Move(fromFolder, newFolder); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tabsFromPath := filepath.Join(util.DataDir, fromBox.ID, fromFolder)\n\t\t\tabsToPath := filepath.Join(util.DataDir, toBox.ID, newFolder)\n\t\t\tif filelock.IsExist(absToPath) {\n\t\t\t\tfilelock.Remove(absToPath)\n\t\t\t}\n\t\t\tif err = filelock.Rename(absFromPath, absToPath); err != nil {\n\t\t\t\tmsg := fmt.Sprintf(Conf.Language(5), fromBox.Name, fromPath, err)\n\t\t\t\tlogging.LogErrorf(\"move [path=%s] in box [%s] failed: %s\", fromPath, fromBox.ID, err)\n\t\t\t\terr = errors.New(msg)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tnewPath = path.Join(toFolder, tree.ID+\".sy\")\n\n\tif isSameBox {\n\t\tif err = fromBox.Move(fromPath, newPath); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\ttree, err = filesys.LoadTree(fromBox.ID, newPath, luteEngine)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tmoveTree(tree)","sourceCodeStart":1893,"sourceCodeEnd":1929,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/file.go#L1893-L1929","documentation":"After SiYuan already tried and retried the physical rename of a .sy file, filelock.Rename still failed; the error is wrapped as localized 'Move notebook [%s] file [%s] failed: %s' (key 5) with the source box name, path, and OS error. This is an I/O-level failure surfaced to the user, distinct from the pre-move validation errors.","triggerScenarios":"filelock.Rename(absFromPath, absToPath) fails during moveDoc — typically the target file appeared mid-move, antivirus/file-locking on Windows holds the .sy, or a cross-device rename occurs.","commonSituations":"Another client or plugin has the file open; Windows file locks (search indexer, backup tools); running out of disk space; sync conflict writing the target simultaneously.","solutions":["Read the trailing OS error in the message to identify the underlying cause","Close apps/plugins holding the .sy file and retry the move","Check disk space and that the file is not opened by another SiYuan client, then retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const exists = await fileExists(absToPath); if (exists) throw new Error('Destination already occupied, aborting move')","typeGuard":null,"tryCatchPattern":"try { await fetchPost('/api/filetree/moveDocs', args) } catch (e) { if (String(e).startsWith('Move notebook')) { logWithOsError(e); /* notify user, keep source data */ } }","preventionTips":["Avoid moving docs while sync or other clients are active","Exclude the workspace from antivirus/indexer real-time scanning","Ensure sufficient disk space before bulk moves"],"tags":["filesystem","move","io-error"],"backgroundTag":"file-write-failed","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}