siyuan-note/siyuan · error

icon [ ] not exists or not available

Error message

icon [%s] not exists or not available

What it means

SetIcon validates the requested icon name against the list of discovered, currently available icons (containIcon over Conf.Appearance.Icons). If the name is absent or the icon package is not installed/available, the kernel rejects the change and returns this error; the current icon is left unchanged.

Solutions

  1. Check the exact icon name against the installed icons (Settings - Appearance - Icon) and correct the spelling
  2. Install or re-download the icon package into app/appearance/icons (or via marketplace) before setting it
  3. Query the current available icons via the appearance config and pick one of those names
  4. Remove the stale icon reference from configuration if the icon was intentionally removed

Example fix

// before
SetIcon("myCustomIcon") // not installed
// after
SetIcon("litheness") // an installed, available icon package
Defensive patterns

Strategy: validation

Validate before calling

const icons = await fetchPost("/api/setting/getAppearance", {}).icons || [];
if (!icons.some(i => i.name === requestedIcon)) throw new Error(`icon ${requestedIcon} not installed`);

Try / catch

try {
  await setIcon(name);
} catch (e) {
  if (String(e).includes("not exists or not available")) {
    // fall back to a known-installed icon, e.g. "litheness"
  }
}

Prevention

When it happens

Trigger: Calling the icon-setting API (e.g. /api/setting/setAppearance icon parameter) with an icon name that is not installed in the appearance/icons directory or is disabled/unavailable.

Common situations: Typo in the icon package name; icon theme was deleted or not synced to the new machine; plugin/automation script sets an icon from another installation; icon exists on disk but is not registered (missing in available list).

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at kernel/model/appearance.go:76

		Conf.Appearance.ThemeLight = "daylight"
		Conf.Appearance.ThemeJS = false
	}
	if !containIcon(Conf.Appearance.Icon, Conf.Appearance.Icons) {
		Conf.Appearance.Icon = "litheness"
	}
	Conf.m.Unlock()

	Conf.Save()

	util.InitEmojiChars()
}

func SetIcon(icon string) error {
	Conf.m.Lock()
	defer Conf.m.Unlock()

	if !containIcon(icon, Conf.Appearance.Icons) {
		return fmt.Errorf("icon [%s] not exists or not available", icon)
	}
	Conf.Appearance.Icon = icon
	return nil
}

func SetTheme(theme string, modes []int, appearanceMode string) error {
	Conf.m.Lock()
	defer Conf.m.Unlock()

	if theme != "" {
		for _, mode := range modes {
			switch mode {
			case 0:
				if !containTheme(theme, Conf.Appearance.LightThemes) {
					return fmt.Errorf("theme [%s] not exists or not available for light mode", theme)
				}
				Conf.Appearance.ThemeLight = theme
			case 1:

View on GitHub (pinned to 9f775e8a12)