{"record":{"id":"8c34bc58382bd129","repo":"siyuan-note/siyuan","slug":"boot-appearance-path-is-too-deep-or-long","errorCode":null,"errorMessage":"boot appearance path is too deep or long","messagePattern":"boot appearance path is too deep or long","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":535,"sourceCode":"\t}\n\tvar totalSize int64\n\tentryCount := 0\n\terr = filepath.WalkDir(appearanceDir, func(filePath string, entry os.DirEntry, walkErr error) error {\n\t\tif walkErr != nil {\n\t\t\treturn walkErr\n\t\t}\n\t\trelativePath, relativeErr := filepath.Rel(appearanceDir, filePath)\n\t\tif relativeErr != nil {\n\t\t\treturn ErrBootAppearanceAssetForbidden\n\t\t}\n\t\tif relativePath != \".\" {\n\t\t\tentryCount++\n\t\t\tif entryCount > maxBootAppearanceEntries {\n\t\t\t\treturn errors.New(\"too many boot appearance entries\")\n\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})","sourceCodeStart":517,"sourceCodeEnd":553,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/boot_appearance.go#L517-L553","documentation":"Thrown by validateBootAppearancePackage when a package entry's relative path is longer than maxBootAppearancePathLength or nested deeper than maxBootAppearancePathDepth. Bounds both name length and directory nesting for safety.","triggerScenarios":"A package containing files under deeply nested directories (e.g. assets/layers/v2/png/frames/final/... ) or with very long file names; detected during the package walk.","commonSituations":"Re-zipping exported design-tool folders that carry deep internal structure, or archiving tools preserving original absolute-ish paths.","solutions":["Flatten the directory structure so assets sit in few shallow directories.","Shorten long file/folder names in the package.","Repackage the archive so paths are relative and shallow before installing."],"exampleFix":"// before\nassets/layers/v2/frames/final/export/background.png\n// after\nbackground.png","handlingStrategy":"validation","validationCode":"function pathTooDeep(rel) { const s = rel.replace(/\\\\/g, \"/\"); return s.length > 256 || s.split(\"/\").length > 12; }","typeGuard":null,"tryCatchPattern":"try { await installBootAppearance(zipPath); } catch (e) { if (String(e).includes(\"too deep or long\")) { /* flatten package paths */ } else throw e; }","preventionTips":["Repackage archives with flattened directories","Avoid re-zipping raw design-tool exports","Keep asset filenames short and shallow"],"tags":["limit","path","boot-appearance"],"backgroundTag":"path-traversal-blocked","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"}