siyuan-note/siyuan · error

invalid display name

Error message

invalid display name

What it means

After ensuring a default exists, validateBootAppearanceDisplayName iterates every entry of the displayName map. A language key must be non-blank and at most 32 bytes, and each value must be non-blank, at most 128 bytes, and free of NUL/CR/LF characters. Any violation yields this generic "invalid display name" error.

Solutions

  1. Locate the offending entry in the manifest's displayName map and give both the language key and value non-blank, trimmed content
  2. Shorten names to at most 128 bytes and language tags to at most 32 bytes
  3. Strip newlines, carriage returns, and control characters from all display names

Example fix

// before
"displayName": {"default": "Line one\nLine two"}
// after
"displayName": {"default": "Line one Line two"}
Defensive patterns

Strategy: validation

Validate before calling

function validDisplayNameMap(m) {
  return Object.entries(m ?? {}).every(([lang, v]) =>
    lang.trim() !== "" && String(v).trim() !== "" && lang.length <= 32 &&
    v.length <= 128 && !/[\x00\r\n]/.test(v));
}

Type guard

function isCleanString(s) {
  return typeof s === "string" && s.trim() !== "" && s.length <= 128 && !/[\x00\r\n]/.test(s);
}

Try / catch

try {
  await loadManifest(pkgPath);
} catch (e) {
  if (String(e).includes("invalid display name")) {
    // scan all displayName entries for blanks, oversize, or control chars
  }
}

Prevention

When it happens

Trigger: Loading a package whose displayName map contains: an empty-string language key; a value that is empty/whitespace; a language tag longer than 32 bytes; a name longer than 128 bytes; or a value containing \x00, \r, or \n.

Common situations: Pasting a multi-line title from a document into a manifest value; an oversized translated name; BCP-47 tags with long private-use subtags exceeding 32 bytes; editors inserting newlines into JSON string values.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/54199b7ac1dce996. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/boot_appearance.go:684

		info, lstatErr := os.Lstat(current)
		if lstatErr != nil {
			return lstatErr
		}
		if info.Mode()&os.ModeSymlink != 0 {
			return ErrBootAppearanceAssetForbidden
		}
	}
	return nil
}

func validateBootAppearanceDisplayName(displayName map[string]string) error {
	if strings.TrimSpace(displayName["default"]) == "" {
		return errors.New("displayName.default is required")
	}
	for lang, value := range displayName {
		if strings.TrimSpace(lang) == "" || strings.TrimSpace(value) == "" || len(lang) > 32 || len(value) > 128 ||
			strings.ContainsAny(value, "\x00\r\n") {
			return errors.New("invalid display name")
		}
	}
	return nil
}

func normalizeBootAppearanceFrontends(manifestFrontends, pluginFrontends []string) ([]string, error) {
	candidates := manifestFrontends
	if len(candidates) == 0 {
		candidates = pluginFrontends
	}
	frontends := []string{}
	seen := map[string]bool{}
	for _, frontend := range candidates {
		if frontend == "all" && len(manifestFrontends) == 0 {
			for _, normalized := range []string{"desktop", "mobile"} {
				if !seen[normalized] {
					seen[normalized] = true
					frontends = append(frontends, normalized)

View on GitHub (pinned to 9f775e8a12)