{"record":{"id":"3cd64c7a405d546e","repo":"siyuan-note/siyuan","slug":"conf-language-49","errorCode":null,"errorMessage":"Conf.Language(49)","messagePattern":"Conf\\.Language\\(49\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/file.go","lineNumber":1438,"sourceCode":"const (\n\tDailyNoteAttrPrefix = \"custom-dailynote-\"\n\tNodeAttrTitleEmpty  = \"custom-sy-title-empty\"\n\tDocHiddenAttr       = \"custom-hidden\"\n)\n\nfunc CreateDailyNote(boxID string) (p string, existed bool, err error) {\n\tcreateDocLock.Lock()\n\tdefer createDocLock.Unlock()\n\n\tbox := Conf.Box(boxID)\n\tif nil == box {\n\t\terr = ErrBoxNotFound\n\t\treturn\n\t}\n\n\tboxConf := box.GetConf()\n\tif \"\" == boxConf.DailyNoteSavePath || \"/\" == boxConf.DailyNoteSavePath {\n\t\terr = errors.New(Conf.Language(49))\n\t\treturn\n\t}\n\n\thPath, err := RenderGoTemplateInBox(boxConf.DailyNoteSavePath, box.ID)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tFlushTxQueue()\n\n\thPath = util.TrimSpaceInPath(hPath)\n\texistRoot := treenode.GetBlockTreeRootByHPath(box.ID, hPath)\n\tif nil != existRoot {\n\t\texisted = true\n\t\tp = existRoot.Path\n\n\t\ttree, loadErr := LoadTreeByBlockID(existRoot.RootID)\n\t\tif nil != loadErr {","sourceCodeStart":1420,"sourceCodeEnd":1456,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/file.go#L1420-L1456","documentation":"CreateDailyNote in kernel/model/file.go:1438 reads the notebook's configured DailyNoteSavePath. If it is empty or set to the root '/', the daily-note document has no defined location, so the function returns localized kernel message 49: 'Please specify the daily note save path in the Notebook Settings'. It is a configuration precondition, not a runtime fault.","triggerScenarios":"Invoking CreateDailyNote (API /api/filetree/createDailyNote, or the daily-note append/prepend/prepare actions, plugins like dailynoteCreate) on a notebook whose DailyNoteSavePath was never configured, or which was cleared/set to '/' in notebook settings.","commonSituations":"A freshly created notebook used before opening Notebook Settings; restoring or syncing a workspace where notebook conf was lost; a plugin or script that creates a notebook programmatically and immediately tries to create its daily note; users deleting the daily-note path entry thinking '/' means 'notebook root'.","solutions":["Open the notebook's settings (right-click notebook > Settings or Settings - Collect - Notebook) and set the 'Daily note save path' to a non-root template path such as '/daily note/{{now | date \"2006-01\"}}/2006-01-02'.","Alternatively call the API on a notebook that already has DailyNoteSavePath configured.","If automating, ensure the notebook conf JSON (conf.json of the notebook) contains a non-empty, non-'/' dailynoteSavePath before invoking."],"exampleFix":"// before: notebook conf.json has no dailynoteSavePath\nPOST /api/filetree/createDailyNote {\"notebook\": \"20240101120000-abc\"} // -> error 49\n// after: set dailynoteSavePath = \"/daily note/{{now | date \\\"2006-01\\\"}}/2006-01-02\" in notebook settings, then retry","handlingStrategy":"validation","validationCode":"const conf = await getNotebookConf(boxID);\nconst p = conf.conf?.dailynoteSavePath || conf.box?.dailynoteSavePath;\nif (!p || p === \"/\") {\n  throw new Error(`notebook ${boxID} has no daily note save path configured`);\n}","typeGuard":"function hasDailyNotePath(conf) {\n  return typeof conf?.dailynoteSavePath === \"string\" && conf.dailynoteSavePath !== \"/\" && conf.dailynoteSavePath.length > 0;\n}","tryCatchPattern":"try {\n  await createDailyNote(boxID);\n} catch (e) {\n  if (String(e.msg).includes(\"daily note save path\")) {\n    await setNotebookConf(boxID, {...conf, dailynoteSavePath: \"/daily note/{{now | date \\\"2006-01\\\"}}/2006-01-02\"});\n    await createDailyNote(boxID);\n  } else { throw e; }\n}","preventionTips":["After creating a notebook programmatically, set the daily note save path before any daily-note automation runs.","Validate notebook conf after workspace restore/sync — the path can be lost.","Do not configure '/' as the save path; it is explicitly rejected."],"tags":["go","configuration","daily-note"],"backgroundTag":"missing-required-config-field","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}