{"record":{"id":"6dfd97e38acea869","repo":"siyuan-note/siyuan","slug":"too-many-layers-d","errorCode":null,"errorMessage":"too many layers: %d","messagePattern":"too many layers: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":414,"sourceCode":"\t\treturn\n\t}\n\tif manifest.SchemaVersion != bootAppearanceSchemaVersion || manifest.ID != appearanceID {\n\t\terr = errors.New(\"unsupported schema version or mismatched appearance ID\")\n\t\treturn\n\t}\n\tif err = validateBootAppearanceDisplayName(manifest.DisplayName); err != nil {\n\t\treturn\n\t}\n\tfrontends, frontendErr := normalizeBootAppearanceFrontends(manifest.Frontends, pkg.Frontends)\n\tif frontendErr != nil {\n\t\terr = frontendErr\n\t\treturn\n\t}\n\tif err = validateOptionalBootAppearanceColor(manifest.BackgroundColor); err != nil {\n\t\treturn\n\t}\n\tif len(manifest.Layers) > maxBootAppearanceLayers {\n\t\terr = fmt.Errorf(\"too many layers: %d\", len(manifest.Layers))\n\t\treturn\n\t}\n\n\tret = &BootAppearance{\n\t\tEnabled:         true,\n\t\tProvider:        pkg.Name,\n\t\tAppearance:      appearanceID,\n\t\tDisplayName:     bazaar.GetPreferredLocaleString(bazaar.LocaleStrings(manifest.DisplayName), appearanceID),\n\t\tFrontends:       frontends,\n\t\tBackgroundColor: manifest.BackgroundColor,\n\t\tOfficialUI: &BootAppearanceOfficialUI{\n\t\t\tShowLogo:    true,\n\t\t\tShowDetails: true,\n\t\t},\n\t}\n\tif manifest.OfficialUI.ShowLogo != nil {\n\t\tret.OfficialUI.ShowLogo = *manifest.OfficialUI.ShowLogo\n\t}","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L396-L432","documentation":"The boot appearance manifest declares more layers (background images/videos) than the kernel allows (maxBootAppearanceLayers). The kernel caps layer count to keep boot rendering cheap and prevent resource abuse, and refuses to load the appearance outright.","triggerScenarios":"GetBootAppearances or getBootAppearanceByID loads a manifest.json whose \"layers\" array length exceeds maxBootAppearanceLayers.","commonSituations":"A plugin author stacks many decorative animation layers in one appearance; an appearance was extended layer-by-layer over time past the cap; a generated manifest from a tool emits unbounded layers.","solutions":["Reduce the \"layers\" array in manifest.json to at most maxBootAppearanceLayers entries (merge visual effects into fewer image/video layers).","Split the design into multiple boot appearances instead of one oversized one.","Check the current cap (maxBootAppearanceLayers in kernel/model/boot_appearance.go) and design within it."],"exampleFix":"// before: manifest.json layers\n\"layers\": [ {\"id\":\"l1\"}, {\"id\":\"l2\"}, {\"id\":\"l3\"}, {\"id\":\"l4\"}, {\"id\":\"l5\"}, ... ]\n// after (cap is e.g. 4)\n\"layers\": [ {\"id\":\"l1\"}, {\"id\":\"l2\"}, {\"id\":\"l3\"}, {\"id\":\"l4\"} ]","handlingStrategy":"validation","validationCode":"const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));\nif (Array.isArray(manifest.layers) && manifest.layers.length > MAX_BOOT_APPEARANCE_LAYERS) throw new Error(`too many layers: ${manifest.layers.length}`);","typeGuard":null,"tryCatchPattern":"try { loadAppearance(id); } catch (e) { if (/too many layers/.test(String(e))) { trimLayers(manifest, MAX_BOOT_APPEARANCE_LAYERS); } }","preventionTips":["Design appearances with a small fixed layer budget","Merge decorative effects into fewer composite assets","Count layers in your build script and fail early"],"tags":["boot-appearance","layers","limit-exceeded","manifest"],"backgroundTag":"value-out-of-range","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"}