multica-ai/multica · error
plugin archive exceeds %d bytes
Error message
plugin archive exceeds %d bytes
What it means
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.
Source
Thrown at server/cmd/multica/cmd_plugin.go:152
ArchiveDigest string `json:"archive_digest"`
ArtifactDigest string `json:"artifact_digest"`
SizeBytes int64 `json:"size_bytes"`
FileCount int `json:"file_count"`
}
func loadPluginSource(source string) ([]byte, plugincontract.Artifact, error) {
info, err := os.Stat(source)
if err != nil {
return nil, plugincontract.Artifact{}, err
}
if info.IsDir() {
return plugincontract.PackDirectory(source)
}
if !info.Mode().IsRegular() {
return nil, plugincontract.Artifact{}, fmt.Errorf("plugin source %q is not a directory or regular ZIP", source)
}
if info.Size() > plugincontract.MaxArchiveSize {
return nil, plugincontract.Artifact{}, fmt.Errorf("plugin archive exceeds %d bytes", plugincontract.MaxArchiveSize)
}
archive, err := os.ReadFile(source)
if err != nil {
return nil, plugincontract.Artifact{}, err
}
artifact, err := plugincontract.ValidateArtifact(archive)
return archive, artifact, err
}
func pluginDigestResult(artifact plugincontract.Artifact) pluginDigestOutput {
return pluginDigestOutput{
PluginKey: artifact.Manifest.Metadata.Key, Version: artifact.Manifest.Metadata.Version,
ManifestDigest: plugincontract.DigestBytes(artifact.CanonicalManifest), ArchiveDigest: artifact.ArchiveDigest,
ArtifactDigest: artifact.ArtifactDigest, SizeBytes: artifact.SizeBytes, FileCount: len(artifact.Files),
}
}
func printPluginDigest(cmd *cobra.Command, result pluginDigestOutput, output string) error {View on GitHub (pinned to 2c0912b6ec)
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.
Example fix
// before zip -r plugin.zip . // includes node_modules (~50MB) -> exceeds limit // after printf 'node_modules/ *.map ' > .zipignore zip -r plugin.zip . -x 'node_modules/*' '*.map'
Defensive patterns
Strategy: validation
Validate before calling
const limit = plugincontract.MaxArchiveSize
if fi, err := os.Stat(zipPath); err == nil && fi.Size() > limit {
return fmt.Errorf("archive %d bytes exceeds %d; trim contents", fi.Size(), limit)
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- plugin directory %q is not empty
- plugin source %q is not a directory or regular ZIP
- validate Plugin: %w
- validate Plugin before install: %w
- invalid direction %q (want \"up\" or \"down\")
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/2b7d8bac079e5e23.
Report an issue: GitHub.