{"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/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L532-L568","documentation":"For each regular file in the boot appearance package the walker adds its size to totalSize. When the accumulated size exceeds maxBootAppearanceTotalSize, loading aborts with this error. It is a resource cap that keeps one package from consuming unbounded disk space.","triggerScenarios":"Installing a boot appearance package whose files total more bytes than maxBootAppearanceTotalSize — e.g. a large video or high-resolution image layers included uncompressed.","commonSituations":"Including multi-hundred-MB video backgrounds in a boot animation; bundling several 4K PNG layers; packaging source assets plus compressed exports together.","solutions":["Compress or downscale the media assets (transcode video, convert images to WebP, lower resolution/bitrate) so the total fits under the limit","Remove unused or duplicated assets from the package and repackage","Reference media externally if the appearance format allows it instead of bundling them"],"exampleFix":"// before: bundle raw 4K video (800MB)\n// after\nffmpeg -i boot-bg.mp4 -vcodec libx264 -crf 28 -vf scale=1280:-1 boot-bg-small.mp4","handlingStrategy":"validation","validationCode":"function totalSizeWithinLimit(files, maxBytes) {\n  return files.reduce((n, f) => n + f.size, 0) <= maxBytes;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await installBootAppearance(zipPath);\n} catch (e) {\n  if (String(e).includes(\"too large\")) {\n    // compress or drop media assets\n  }\n}","preventionTips":["Compress video and images before bundling","Audit package size with `du -sh` or archive listing before release","Do not bundle source assets alongside exports"],"tags":["boot-appearance","package-limits","file-size"],"backgroundTag":"file-size-limit-exceeded","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"}