siyuan-note/siyuan · error

Please specify the daily note save path in the Notebook…

Error message

Please specify the daily note save path in the Notebook Settings

What it means

model.CreateDailyNote requires the target notebook to have a daily-note save path configured: if boxConf.DailyNoteSavePath is empty or "/", the localized "Please specify the daily note save path in the Notebook Settings" (Conf.Language(49)) is returned and no daily note is created. Reached from POST /api/filetree/createDailyNote and from appendDailyNoteBlock/prependDailyNoteBlock, which auto-create today's daily note.

Solutions

  1. Open Notebook Settings - Daily note and set a save path template such as /Daily Notes/{{now | date "2006-01-02"}}
  2. Or set it programmatically via POST /api/notebook/setNotebookConf with conf.dailyNoteSavePath
  3. Then retry the daily-note creation

Example fix

# before
POST /api/filetree/createDailyNote {"notebook":"20260101120000-abcdef"}
-> "Please specify the daily note save path in the Notebook Settings"

# after: configure the notebook first, then create
POST /api/notebook/setNotebookConf
{ "notebook": "20260101120000-abcdef", "conf": { "dailyNoteSavePath": "/Daily Notes/{{now | date \"2006-01-02\"}}" } }
POST /api/filetree/createDailyNote {"notebook":"20260101120000-abcdef"}
Defensive patterns

Strategy: validation

Validate before calling

box := model.Conf.Box(boxID)
if box == nil {
	return model.ErrBoxNotFound
}
conf := box.GetConf()
if conf.DailyNoteSavePath == "" || conf.DailyNoteSavePath == "/" {
	return errors.New("configure DailyNoteSavePath for this notebook first")
}
p, existed, err := model.CreateDailyNote(boxID)

Type guard

func hasDailyNoteConfig(boxID string) bool {
	box := model.Conf.Box(boxID)
	if box == nil {
		return false
	}
	p := box.GetConf().DailyNoteSavePath
	return p != "" && p != "/"
}

Prevention

When it happens

Trigger: POST /api/filetree/createDailyNote (or /api/block/appendDailyNoteBlock, /api/block/prependDailyNoteBlock) for a notebook whose Notebook Settings never set a Daily note save path, or where it was cleared/set to '/'.

Common situations: Freshly created notebooks used as daily-note targets; API users assuming a global default applies per notebook; imported notebooks without settings.

Related errors


AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18). Data as JSON: /api/errors/983e44647739391e. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/file.go:1486

const (
	DailyNoteAttrPrefix = "custom-dailynote-"
	NodeAttrTitleEmpty  = "custom-sy-title-empty"
	DocHiddenAttr       = "custom-hidden"
)

func CreateDailyNote(boxID string) (p string, existed bool, err error) {
	createDocLock.Lock()
	defer createDocLock.Unlock()

	box := Conf.Box(boxID)
	if nil == box {
		err = ErrBoxNotFound
		return
	}

	boxConf := box.GetConf()
	if "" == boxConf.DailyNoteSavePath || "/" == boxConf.DailyNoteSavePath {
		err = errors.New(Conf.Language(49))
		return
	}

	hPath, err := RenderGoTemplateInBox(boxConf.DailyNoteSavePath, box.ID)
	if err != nil {
		return
	}

	FlushTxQueue()

	hPath = util.TrimSpaceInPath(hPath)
	existRoot := treenode.GetBlockTreeRootByHPath(box.ID, hPath)
	if nil != existRoot {
		existed = true
		p = existRoot.Path

		tree, loadErr := LoadTreeByBlockID(existRoot.RootID)
		if nil != loadErr {

View on GitHub (pinned to afa823b6b4)