siyuan-note/siyuan · warning

Please specify the daily note save path in the Notebook Sett

Error message

Please specify the daily note save path in the Notebook Settings

What it means

Thrown by CreateDailyNote when the notebook's box configuration has no DailyNoteSavePath set (empty string or literal '/'). Conf.Language(49) = 'Please specify the daily note save path in the Notebook Settings'. Daily notes require a Go-template path (e.g., '/Daily Notes/{{now | date "2006/01"}}/{{now | date "2006-01-02"}}') to know where to create the note; without it, the function cannot proceed.

Source

Thrown at kernel/model/file.go:1422

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 251596fc0d)

Solutions

  1. Open Notebook Settings for the target notebook and set the Daily Note Save Path template.
  2. Set a default daily note save path programmatically via the notebook configuration API before calling CreateDailyNote.
  3. In UI flows, detect an empty DailyNoteSavePath and prompt the user to configure it before attempting creation.
  4. For programmatic callers, pre-validate boxConf.DailyNoteSavePath and show a configuration dialog if empty.

Example fix

// before
p, existed, err := model.CreateDailyNote(boxID)

// after
box := conf.Box(boxID)
if box != nil {
    bc := box.GetConf()
    if bc.DailyNoteSavePath == "" || bc.DailyNoteSavePath == "/" {
        return "", false, errors.New("configure daily note save path first")
    }
}
p, existed, err := model.CreateDailyNote(boxID)
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check: ensure daily note save path is configured
box := conf.Box(boxID)
if box == nil {
    return "", false, errors.New("notebook not found")
}
bc := box.GetConf()
if bc.DailyNoteSavePath == "" || bc.DailyNoteSavePath == "/" {
    return "", false, errors.New("configure daily note save path in notebook settings")
}

Type guard

func hasDailyNotePath(boxID string) bool {
    box := conf.Box(boxID)
    if box == nil {
        return false
    }
    bc := box.GetConf()
    return bc.DailyNoteSavePath != "" && bc.DailyNoteSavePath != "/"
}

Prevention

When it happens

Trigger: Calling CreateDailyNote(boxID) on a notebook whose boxConf.DailyNoteSavePath is unset. This happens for newly created notebooks that haven't been configured, or notebooks imported from templates that don't include a daily-note path.

Common situations: A new notebook is created and the user immediately presses the daily-note shortcut without configuring the save path. A notebook was imported/migrated and the daily note setting was lost. The user is on a fresh workspace and hasn't set up notebook preferences yet.

Related errors


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