{"record":{"id":"fb0908e03a4d7bc1","repo":"Tencent/WeKnora","slug":"errskillbundleinvalid","errorCode":"ErrSkillBundleInvalid","errorMessage":"%w: archive is too large","messagePattern":"%w: archive is too large","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/tenant_skill_bundle.go","lineNumber":105,"sourceCode":"\tfiles, err := stripSkillRootPrefix(raw, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn skillBundleFromFiles(archive, files)\n}\n\nfunc unzipSkillArchive(archive []byte, opts SkillBundleParseOptions) (map[string][]byte, error) {\n\tentries, err := skillZipEntries(archive, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\traw := make(map[string][]byte, len(entries))\n\tvar totalBytes int64\n\tfor _, item := range entries {\n\t\tentryBytes := item.size\n\t\tif totalBytes+entryBytes > maxSkillBundleTotalBytes {\n\t\t\treturn nil, fmt.Errorf(\"%w: archive is too large\", ErrSkillBundleInvalid)\n\t\t}\n\t\ttotalBytes += entryBytes\n\t\tcontent, err := readLimitedZipEntry(item.file)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif int64(len(content)) > entryBytes {\n\t\t\tactualExcess := int64(len(content)) - entryBytes\n\t\t\tif totalBytes+actualExcess > maxSkillBundleTotalBytes {\n\t\t\t\treturn nil, fmt.Errorf(\"%w: archive is too large\", ErrSkillBundleInvalid)\n\t\t\t}\n\t\t\ttotalBytes += actualExcess\n\t\t}\n\t\traw[item.name] = content\n\t}\n\treturn raw, nil\n}\n","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/tenant_skill_bundle.go#L87-L123","documentation":"unzipSkillArchive rejects a skill archive whose decompressed entries exceed maxSkillBundleTotalBytes (a zip-bomb / size-limit guard). ErrSkillBundleInvalid is wrapped; the upload is treated as an invalid bundle, not a server error.","triggerScenarios":"Thrown at internal/application/service/tenant_skill_bundle.go:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the archive's contents or compress/split the skill files","Raise maxSkillBundleTotalBytes only if the business allows larger bundles","Validate archive size before upload to fail fast client-side"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}