siyuan-note/siyuan · error
Conf.Language(114)
Error message
Conf.Language(114)
What it means
After ContainsMarker passes, RenameTag trims leading/trailing '/' and whitespace; if the result is empty it returns Conf.Language(114) = 'Tag cannot be empty'. This catches labels that are only markers, slashes, or spaces (e.g. '#', '/', ' ', '/#') which survived the marker check but hold no real content.
Source
Thrown at kernel/model/tag.go:136
updateAttributeViewBlockText(updateNodes)
sql.FlushQueue()
util.PushClearProgress()
return
}
func RenameTag(oldLabel, newLabel string) (err error) {
if invalidChar := treenode.ContainsMarker(newLabel); "" != invalidChar {
return fmt.Errorf(Conf.Language(112), invalidChar)
}
newLabel = strings.TrimPrefix(newLabel, "/")
newLabel = strings.TrimSuffix(newLabel, "/")
newLabel = strings.TrimSpace(newLabel)
if "" == newLabel {
return errors.New(Conf.Language(114))
}
if oldLabel == newLabel {
return
}
util.PushEndlessProgress(Conf.Language(110))
util.RandomSleep(500, 1000)
tags := sql.QueryTagSpansByLabel(oldLabel)
treeBlocks := map[string][]string{}
for _, tag := range tags {
if blocks, ok := treeBlocks[tag.RootID]; !ok {
treeBlocks[tag.RootID] = []string{tag.BlockID}
} else {
treeBlocks[tag.RootID] = append(blocks, tag.BlockID)
}
}View on GitHub (pinned to 251596fc0d)
Solutions
- Provide a non-empty label containing at least one non-marker, non-slash character.
- Frontend: disable Rename when the trimmed field is empty.
- If renaming to remove a tag, use the delete-tag flow instead of renaming to empty.
Example fix
// before: newLabel="/" -> error 114 // after: newLabel="work"
Defensive patterns
Strategy: validation
Validate before calling
// Go caller
label := strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(newLabel, "/"), "/"))
if label == "" {
return errors.New("tag label cannot be empty")
} Type guard
// Go
func nonEmptyTagLabel(label string) bool {
t := strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(label, "/"), "/"))
return t != ""
} Prevention
- Disable the Rename submit button when the field is blank.
- Run the same trim-then-empty check on the client.
- Distinguish 'rename to empty' from 'delete tag' in the UI.
When it happens
Trigger: POST /api/tag/renameTag with newLabel that is empty, all whitespace, only '/' separators, or after marker stripping becomes empty. Typing only spaces or slashes in the rename field.
Common situations: User clears the rename field and submits. Label is just '/'. Label after removing a leading '#' leaves nothing. Programmatic rename with an uninitialized string.
Related errors
- Conf.Language(112) {invalidChar}
- Conf.Language(132)
- Conf.Language(142)
- Conf.Language(123)
- Conf.Language(194)
AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12).
Data as JSON: /api/errors/006e40bf4b80e828.
Report an issue: GitHub.