{"record":{"id":"fcfff84c474dfd90","repo":"siyuan-note/siyuan","slug":"boot-appearance-not-found","errorCode":null,"errorMessage":"boot appearance not found","messagePattern":"boot appearance not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":58,"sourceCode":"const (\n\tbootAppearanceSchemaVersion = 1\n\tbootAppearanceDirName       = \"boot-appearances\"\n\tbootAppearanceConfigName    = \"boot-appearance.json\"\n\tbootAppearanceManifestName  = \"boot.json\"\n\n\tmaxBootAppearanceManifestSize = 200 * 1024\n\tmaxBootAppearanceStyleSize    = 200 * 1024\n\tmaxBootAppearanceImageSize    = 5 * 1024 * 1024\n\tmaxBootAppearanceVideoSize    = 20 * 1024 * 1024\n\tmaxBootAppearanceTotalSize    = 50 * 1024 * 1024\n\tmaxBootAppearanceLayers       = 8\n\tmaxBootAppearanceEntries      = 256\n\tmaxBootAppearancePathDepth    = 16\n\tmaxBootAppearancePathLength   = 512\n)\n\nvar (\n\tErrBootAppearanceNotFound       = errors.New(\"boot appearance not found\")\n\tErrBootAppearanceAssetForbidden = errors.New(\"boot appearance asset forbidden\")\n\n\tbootAppearanceIDPattern    = regexp.MustCompile(`^[a-z0-9]+(?:-[a-z0-9]+)*$`)\n\tbootAppearanceColorPattern = regexp.MustCompile(`^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$`)\n\tbootAppearanceConfLock     sync.RWMutex\n)\n\n// BootAppearanceSelection 表示当前工作空间选择的启动页外观。\ntype BootAppearanceSelection struct {\n\tSchemaVersion int    `json:\"schemaVersion\"`\n\tProvider      string `json:\"provider\"`\n\tAppearance    string `json:\"appearance\"`\n}\n\n// BootAppearance 描述已经校验且可安全交给启动页渲染的外观。\ntype BootAppearance struct {\n\tEnabled         bool                      `json:\"enabled\"`\n\tProvider        string                    `json:\"provider,omitempty\"`","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L40-L76","documentation":"ErrBootAppearanceNotFound is the sentinel error for boot (splash) appearance selections. When SetBootAppearance or asset resolution receives a provider/appearanceID pair, the kernel validates the package name format and the appearance ID, then verifies the appearance actually exists in the installed plugin directory. Any miss — bad format or nonexistent appearance — is reported as this 'not found' error.","triggerScenarios":"SetBootAppearance with a provider that fails bazaar.IsValidPackageName or an appearanceID failing isValidBootAppearanceID (kernel/model/boot_appearance.go:225); a syntactically valid pair whose appearance directory cannot be resolved by getBootAppearanceByID (line 229); ResolveBootAppearanceAsset referencing an uninstalled/uninstalled-since plugin.","commonSituations":"Typo'd plugin package name; appearance ID not lower-kebab-case (e.g. 'My_Theme' or 'theme v2'); plugin uninstalled or upgraded so the referenced appearance ID no longer exists; selecting an appearance from a plugin not installed in the current workspace.","solutions":["Confirm the plugin (provider) is installed in the current workspace and the package name matches exactly","Use an appearance ID matching ^[a-z0-9]+(-[a-z0-9]+)*$ (lowercase, digits, single hyphens)","List available appearances via GetBootAppearances and pick a valid (provider, appearanceID) pair","Reset the selection to default by calling SetBootAppearance with both fields empty"],"exampleFix":"// before\n_, err := model.SetBootAppearance(\"My Plugin\", \"Fancy Theme\")\n// after\n_, err := model.SetBootAppearance(\"my-plugin\", \"fancy-theme\")","handlingStrategy":"try-catch","validationCode":"validID := regexp.MustCompile(`^[a-z0-9]+(-[a-z0-9]+)*$`).MatchString(appearanceID)\nproviderOK := bazaar.IsValidPackageName(provider)","typeGuard":"func validSelection(provider, id string) bool {\n  return bazaar.IsValidPackageName(provider) && regexp.MustCompile(`^[a-z0-9]+(-[a-z0-9]+)*$`).MatchString(id)\n}","tryCatchPattern":"if _, err := model.SetBootAppearance(p, id); errors.Is(err, model.ErrBootAppearanceNotFound) {\n  // fall back to default or re-list available appearances\n}","preventionTips":["Validate ID format client-side before calling","Confirm plugin is installed in the current workspace","Re-check selection after plugin uninstall/upgrade","Reset with empty strings when unsure"],"tags":["go","kernel","boot-appearance","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}