{"record":{"id":"2b7d8bac079e5e23","repo":"multica-ai/multica","slug":"plugin-archive-exceeds-d-bytes","errorCode":null,"errorMessage":"plugin archive exceeds %d bytes","messagePattern":"plugin archive exceeds (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_plugin.go","lineNumber":152,"sourceCode":"\tArchiveDigest  string `json:\"archive_digest\"`\n\tArtifactDigest string `json:\"artifact_digest\"`\n\tSizeBytes      int64  `json:\"size_bytes\"`\n\tFileCount      int    `json:\"file_count\"`\n}\n\nfunc loadPluginSource(source string) ([]byte, plugincontract.Artifact, error) {\n\tinfo, err := os.Stat(source)\n\tif err != nil {\n\t\treturn nil, plugincontract.Artifact{}, err\n\t}\n\tif info.IsDir() {\n\t\treturn plugincontract.PackDirectory(source)\n\t}\n\tif !info.Mode().IsRegular() {\n\t\treturn nil, plugincontract.Artifact{}, fmt.Errorf(\"plugin source %q is not a directory or regular ZIP\", source)\n\t}\n\tif info.Size() > plugincontract.MaxArchiveSize {\n\t\treturn nil, plugincontract.Artifact{}, fmt.Errorf(\"plugin archive exceeds %d bytes\", plugincontract.MaxArchiveSize)\n\t}\n\tarchive, err := os.ReadFile(source)\n\tif err != nil {\n\t\treturn nil, plugincontract.Artifact{}, err\n\t}\n\tartifact, err := plugincontract.ValidateArtifact(archive)\n\treturn archive, artifact, err\n}\n\nfunc pluginDigestResult(artifact plugincontract.Artifact) pluginDigestOutput {\n\treturn pluginDigestOutput{\n\t\tPluginKey: artifact.Manifest.Metadata.Key, Version: artifact.Manifest.Metadata.Version,\n\t\tManifestDigest: plugincontract.DigestBytes(artifact.CanonicalManifest), ArchiveDigest: artifact.ArchiveDigest,\n\t\tArtifactDigest: artifact.ArtifactDigest, SizeBytes: artifact.SizeBytes, FileCount: len(artifact.Files),\n\t}\n}\n\nfunc printPluginDigest(cmd *cobra.Command, result pluginDigestOutput, output string) error {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_plugin.go#L134-L170","documentation":"Size guard in loadPluginSource (cmd_plugin.go:152): the candidate ZIP's on-disk size exceeds plugincontract.MaxArchiveSize, so the CLI refuses to read it into memory and validate it. The limit exists to bound memory use of the artifact validator.","triggerScenarios":"Passing a ZIP larger than plugincontract.MaxArchiveSize bytes to `plugin validate` or `plugin install`; accidentally pointing at a large unrelated archive (e.g. a full backup zip) instead of the plugin artifact.","commonSituations":"Bundling node_modules, build output, or assets into the plugin zip; wrong path selecting a big artifact; a repack step pulling in the whole repo.","solutions":["Inspect what is inside the zip (`unzip -l plugin.zip`) and remove bulky, non-plugin content.","Add excludes to the packaging step (e.g. `zip -r plugin.zip dir -x '*/node_modules/*' '*.map')`.","Confirm you pointed at the right archive — the error names the byte limit; compare with `stat plugin.zip`.","If a genuinely larger plugin is required, raise plugincontract.MaxArchiveSize in the shared contract and rebuild the CLI and server together."],"exampleFix":"// before\nzip -r plugin.zip .              // includes node_modules (~50MB) -> exceeds limit\n\n// after\nprintf 'node_modules/\n*.map\n' > .zipignore\nzip -r plugin.zip . -x 'node_modules/*' '*.map'","handlingStrategy":"validation","validationCode":"const limit = plugincontract.MaxArchiveSize\nif fi, err := os.Stat(zipPath); err == nil && fi.Size() > limit {\n    return fmt.Errorf(\"archive %d bytes exceeds %d; trim contents\", fi.Size(), limit)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep an explicit exclude list in your packaging script (node_modules, .map, test fixtures).","Check zip size in CI before invoking plugin validate/install.","Track plugincontract.MaxArchiveSize as a build constraint, not a surprise."],"tags":["cli","plugin","size-limit","validation","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}