{"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/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/boot_appearance.go#L396-L432","documentation":"The manifest declares more layers than maxBootAppearanceLayers allows, so loadBootAppearance refuses to build a BootAppearance with an oversized layer stack. The cap bounds rendering cost and manifest size for the boot screen.","triggerScenarios":"GetBootAppearances/getBootAppearanceByID loading a manifest.json whose layers array length exceeds maxBootAppearanceLayers (kernel constant). Triggered during plugin install scanning, boot-appearance listing, or selection resolution whenever the manifest lists too many image/video layers.","commonSituations":"Plugin author animates a boot screen by stacking dozens of images instead of using video or CSS; merging layers from two templates produced a manifest with duplicates; auto-generated manifest enumerating every frame of an animation as separate layers.","solutions":["Reduce the layers array in the appearance's manifest.json to at most maxBootAppearanceLayers entries","Replace frame-by-frame image layers with a single video layer (mp4) for animations","Merge overlapping visual layers into one image using an image editor","If the manifest was generated by a tool, regenerate it with the layer cap respected"],"exampleFix":"// before (manifest.json layers)\n\"layers\": [{\"id\":\"l1\",\"type\":\"image\",\"src\":\"1.png\"}, ... 20 more]\n// after\n\"layers\": [\n  {\"id\":\"bg\",\"type\":\"image\",\"src\":\"bg.png\"},\n  {\"id\":\"anim\",\"type\":\"video\",\"src\":\"anim.mp4\",\"poster\":\"poster.png\"}\n]","handlingStrategy":"validation","validationCode":"const MAX_LAYERS = 8; // check kernel constant maxBootAppearanceLayers\nif (Array.isArray(manifest.layers) && manifest.layers.length > MAX_LAYERS) {\n  throw new Error(`manifest has ${manifest.layers.length} layers, max ${MAX_LAYERS}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Design boot screens with few layers; use one video instead of many image frames","Validate manifests in CI before packaging the plugin","Cap generated manifests at the kernel's maxBootAppearanceLayers","Deduplicate layers after merging templates"],"tags":["validation","limit-exceeded","plugin","manifest"],"backgroundTag":"value-out-of-range","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}