{"record":{"id":"ad4c9751da8eceb2","repo":"siyuan-note/siyuan","slug":"boot-appearance-package-is-too-large","errorCode":null,"errorMessage":"boot appearance package is too large","messagePattern":"boot appearance package is too large","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":550,"sourceCode":"\t\t\t}\n\t\t\tif len(relativePath) > maxBootAppearancePathLength ||\n\t\t\t\tlen(strings.Split(filepath.ToSlash(relativePath), \"/\")) > maxBootAppearancePathDepth {\n\t\t\t\treturn errors.New(\"boot appearance path is too deep or long\")\n\t\t\t}\n\t\t}\n\t\tif entry.Type()&os.ModeSymlink != 0 {\n\t\t\treturn ErrBootAppearanceAssetForbidden\n\t\t}\n\t\tif entry.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tinfo, infoErr := entry.Info()\n\t\tif infoErr != nil || !info.Mode().IsRegular() {\n\t\t\treturn ErrBootAppearanceAssetForbidden\n\t\t}\n\t\ttotalSize += info.Size()\n\t\tif totalSize > maxBootAppearanceTotalSize {\n\t\t\treturn errors.New(\"boot appearance package is too large\")\n\t\t}\n\t\treturn nil\n\t})\n\treturn err\n}\n\nfunc validateBootAppearanceResource(pluginDir, appearanceDir, relativePath, expectedType string) (filePath,\n\tcontentType string, err error) {\n\tif !isSafeBootAppearanceRelativePath(relativePath) {\n\t\terr = ErrBootAppearanceAssetForbidden\n\t\treturn\n\t}\n\tfilePath = filepath.Join(appearanceDir, filepath.FromSlash(relativePath))\n\tif err = ensureBootAppearancePathHasNoSymlink(pluginDir, filePath); err != nil {\n\t\terr = ErrBootAppearanceAssetForbidden\n\t\treturn\n\t}\n\tinfo, statErr := os.Stat(filePath)","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/boot_appearance.go#L532-L568","documentation":"Thrown by validateBootAppearancePackage when the cumulative size of regular files in the package exceeds maxBootAppearanceTotalSize. Prevents oversized boot appearance packages from bloating the workspace.","triggerScenarios":"Installing a package whose files together exceed the total size cap (e.g. several multi-megabyte background images or videos); the running total crosses the limit during the walk.","commonSituations":"High-resolution uncompressed backgrounds, embedded videos, or forgotten duplicate assets in the archive.","solutions":["Compress assets (WebP/optimized PNG, lower resolution) to bring total size under the cap.","Remove unused or duplicate files from the package.","Trim embedded media (shorter/lower-bitrate video) before repackaging."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const fs = require(\"fs\"), path = require(\"path\");\nfunction pkgSize(dir) { let t = 0; for (const e of fs.readdirSync(dir, {withFileTypes: true})) { const p = path.join(dir, e.name); t += e.isDirectory() ? pkgSize(p) : (e.isFile() ? fs.statSync(p).size : 0); } return t; }\nif (pkgSize(pkgDir) > MAX_TOTAL_SIZE) throw new Error(\"package too large\");","typeGuard":null,"tryCatchPattern":"try { await installBootAppearance(zipPath); } catch (e) { if (String(e).includes(\"too large\")) { /* compress or trim assets */ } else throw e; }","preventionTips":["Optimize images (WebP, correct dimensions) before packaging","Check total package size in CI","Remove duplicate/unused media"],"tags":["limit","size","boot-appearance"],"backgroundTag":"file-size-limit-exceeded","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"}