siyuan-note/siyuan · error

too many boot appearance entries

Error message

too many boot appearance entries

What it means

While walking the extracted contents of a boot appearance package, each non-"." entry increments a counter. When the count exceeds maxBootAppearanceEntries, the walker aborts with this error. This is a resource-safety limit that prevents a malicious or runaway package from exploding the number of files unpacked on disk.

Solutions

  1. Remove unnecessary files from the package so the total entry count stays under the maxBootAppearanceEntries limit and repackage
  2. Exclude build artifacts, caches, and dependency directories (node_modules, .git) from the archive
  3. If you genuinely need more entries, split the appearance into multiple packages or request a limit change upstream

Example fix

// before: zip -r appearance.zip . (includes .git, node_modules)
// after
cat > package.json.ignore <<'EOF'
.git
node_modules
*.log
EOF
zip -r appearance.zip . -x '.git/*' 'node_modules/*'
Defensive patterns

Strategy: validation

Validate before calling

function countEntries(files, max) {
  return files.filter(f => f !== ".").length <= max;
}

Try / catch

try {
  await installBootAppearance(zipPath);
} catch (e) {
  if (String(e).includes("too many boot appearance entries")) {
    // repackage with fewer files
  }
}

Prevention

When it happens

Trigger: Installing or loading a boot appearance package whose archive contains more entries than maxBootAppearanceEntries; archives that unpack many files or nested directories, including zip bombs or accidentally included build artifacts/node_modules.

Common situations: Packaging a theme with thousands of unused asset files; archiving a directory that includes caches, VCS folders, or dependency trees; a deliberately crafted archive designed to exhaust disk.

Understand the failure class

Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/2fec2f0a624aeb7e. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/boot_appearance.go:531

	}
	info, err := os.Stat(appearanceDir)
	if err != nil || !info.IsDir() {
		return ErrBootAppearanceNotFound
	}
	var totalSize int64
	entryCount := 0
	err = filepath.WalkDir(appearanceDir, func(filePath string, entry os.DirEntry, walkErr error) error {
		if walkErr != nil {
			return walkErr
		}
		relativePath, relativeErr := filepath.Rel(appearanceDir, filePath)
		if relativeErr != nil {
			return ErrBootAppearanceAssetForbidden
		}
		if relativePath != "." {
			entryCount++
			if entryCount > maxBootAppearanceEntries {
				return errors.New("too many boot appearance entries")
			}
			if len(relativePath) > maxBootAppearancePathLength ||
				len(strings.Split(filepath.ToSlash(relativePath), "/")) > maxBootAppearancePathDepth {
				return errors.New("boot appearance path is too deep or long")
			}
		}
		if entry.Type()&os.ModeSymlink != 0 {
			return ErrBootAppearanceAssetForbidden
		}
		if entry.IsDir() {
			return nil
		}
		info, infoErr := entry.Info()
		if infoErr != nil || !info.Mode().IsRegular() {
			return ErrBootAppearanceAssetForbidden
		}
		totalSize += info.Size()
		if totalSize > maxBootAppearanceTotalSize {

View on GitHub (pinned to 9f775e8a12)