siyuan-note/siyuan · warning
Conf.Language(142)
Error message
Conf.Language(142)
What it means
The TagSnapshot function rejects a tag name that is empty after removing invisible characters and trimming whitespace. The Language(142) string is the validation message for an empty required field. This guard fires after the repo key check but before the filename validity check.
Source
Thrown at kernel/model/repository.go:1648
repo, err := newRepository()
if err != nil {
return
}
err = repo.RemoveTag(tag)
return
}
func TagSnapshot(id, name string) (err error) {
if 1 > len(Conf.Repo.Key) {
err = errors.New(Conf.Language(26))
return
}
name = util.RemoveInvalid(name)
name = strings.TrimSpace(name)
if "" == name {
err = errors.New(Conf.Language(142))
return
}
if !gulu.File.IsValidFilename(name) {
err = errors.New(Conf.Language(151))
return
}
repo, err := newRepository()
if err != nil {
return
}
index, err := repo.GetIndex(id)
if err != nil {
return
}
View on GitHub (pinned to 251596fc0d)
Solutions
- Provide a non-empty tag name after trimming whitespace
- Validate the name on the frontend before submitting the API request
- Ensure no invisible characters are in the input by running it through util.RemoveInvalid or equivalent client-side sanitization
Example fix
// before
model.TagSnapshot(id, " ")
// after
name = strings.TrimSpace(name)
if name == "" {
return errors.New("tag name is required")
}
model.TagSnapshot(id, name) Defensive patterns
Strategy: validation
Validate before calling
// Validate tag name before calling TagSnapshot
name = strings.TrimSpace(name)
if name == "" {
return errors.New("tag name must not be empty")
} Prevention
- Trim and validate the tag name field in the frontend input component before form submission
- Disable the submit button when the tag name field is empty or whitespace-only
- Use HTML required attribute and client-side validation for the tag name input
When it happens
Trigger: Calling TagSnapshot(id, name) where name is an empty string, contains only whitespace, or contains only invisible/control characters that util.RemoveInvalid strips out. The trimmed result is compared against an empty string and the error is returned.
Common situations: Frontend bug where the tag name input field is not properly validated before the API call. Also occurs when a user accidentally submits with whitespace-only input, or when an automation/plugin passes an empty or malformed name string.
Related errors
- Conf.Language(151)
- Activation code cannot be empty
- invalid notebook ID
- snapshot file ID is required
- snapshot version is not a document
AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12).
Data as JSON: /api/errors/274ba0d4ab9857e7.
Report an issue: GitHub.