{"record":{"id":"30e5fedd93f22023","repo":"siyuan-note/siyuan","slug":"invalid-layer-position-s","errorCode":null,"errorMessage":"invalid layer position [%s]","messagePattern":"invalid layer position \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":492,"sourceCode":"\t\t\t}\n\t\t} else if layer.Poster != \"\" {\n\t\t\terr = errors.New(\"image layer cannot declare a poster\")\n\t\t\treturn nil, err\n\t\t}\n\t\tfit := layer.Fit\n\t\tif fit == \"\" {\n\t\t\tfit = \"cover\"\n\t\t}\n\t\tif !isValidBootAppearanceFit(fit) {\n\t\t\terr = fmt.Errorf(\"invalid layer fit [%s]\", fit)\n\t\t\treturn nil, err\n\t\t}\n\t\tposition := layer.Position\n\t\tif position == \"\" {\n\t\t\tposition = \"center\"\n\t\t}\n\t\tif !isValidBootAppearancePosition(position) {\n\t\t\terr = fmt.Errorf(\"invalid layer position [%s]\", position)\n\t\t\treturn nil, err\n\t\t}\n\t\titem := &BootAppearanceLayer{\n\t\t\tID:       layer.ID,\n\t\t\tType:     layer.Type,\n\t\t\tSrc:      bootAppearanceAssetURL(pkg.Name, appearanceID, layer.Src),\n\t\t\tFit:      fit,\n\t\t\tPosition: position,\n\t\t}\n\t\tif layer.Poster != \"\" {\n\t\t\titem.Poster = bootAppearanceAssetURL(pkg.Name, appearanceID, layer.Poster)\n\t\t}\n\t\tret.Layers = append(ret.Layers, item)\n\t}\n\treturn\n}\n\nfunc validateBootAppearancePackage(pluginDir, appearanceDir string) error {","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L474-L510","documentation":"loadBootAppearance validates each layer of a boot appearance package. Every layer must declare a `position` that is one of a fixed set accepted by isValidBootAppearancePosition (empty defaults to \"center\"). If a manifest layer's position string is non-empty but not a recognized value, package loading aborts with this error naming the offending value.","triggerScenarios":"Calling GetBootAppearances or getBootAppearanceByID while loading a boot appearance package whose manifest.json contains a layer with `position` set to an unknown string (e.g. \"top-left\", \"bottom\", a typo like \"centerr\", or extra whitespace/case variants like \"Center\").","commonSituations":"Hand-editing a boot appearance manifest and mistyping the position; copying a position value from another plugin system with a different vocabulary; a package built for a newer/older format version that added positions this kernel version does not know.","solutions":["Open the package's manifest.json and change the layer's `position` to a valid value accepted by isValidBootAppearancePosition (e.g. \"center\"), or delete the field to use the \"center\" default","Check for typos, surrounding whitespace, and letter case — position matching is exact","If the position value comes from a newer package format, upgrade the SiYuan kernel to a version that supports it"],"exampleFix":"// manifest.json before\n{\"layers\": [{\"id\": \"logo\", \"type\": \"image\", \"src\": \"logo.png\", \"position\": \"top-left\"}]}\n// after\n{\"layers\": [{\"id\": \"logo\", \"type\": \"image\", \"src\": \"logo.png\", \"position\": \"center\"}]}","handlingStrategy":"validation","validationCode":"const VALID_POSITIONS = new Set([\"center\"]); // extend per isValidBootAppearancePosition\nfunction validLayerPosition(p) {\n  return typeof p !== \"string\" || p === \"\" || VALID_POSITIONS.has(p);\n}","typeGuard":"function isKnownPosition(p) { return p === \"\" || p === \"center\"; }","tryCatchPattern":"try {\n  const list = await fetchPost(\"/api/.../getBootAppearances\");\n} catch (e) {\n  if (String(e).includes(\"invalid layer position\")) {\n    // point user to the manifest layer position named in the brackets\n  }\n}","preventionTips":["Use only documented position values in manifest layers","Omit `position` entirely to get the \"center\" default","Keep letter case and spelling exact — no trimming or normalization is applied"],"tags":["boot-appearance","validation","manifest"],"backgroundTag":"invalid-enum-value","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"}