multica-ai/multica · error

install Private Plugin: %w

Error message

install Private Plugin: %w

What it means

Wrap in runPluginInstall (cmd_plugin.go:241): local validation and workspace resolution succeeded, but the multipart upload POST /api/workspaces/{id}/plugins/private/install (client.UploadPrivatePlugin) failed within a 1-minute AtLeastAPITimeout context. Causes range from transport errors to non-2xx server responses (validation server-side, quota, auth) to context deadline exceeded on slow uploads.

Source

Thrown at server/cmd/multica/cmd_plugin.go:241

	archive, artifact, err := loadPluginSource(args[0])
	if err != nil {
		return fmt.Errorf("validate Plugin before install: %w", err)
	}
	workspaceID, err := pluginWorkspaceID(cmd)
	if err != nil {
		return err
	}
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}
	client.WorkspaceID = workspaceID
	ctx, cancel := context.WithTimeout(context.Background(), cli.AtLeastAPITimeout(time.Minute))
	defer cancel()
	var result map[string]any
	path := "/api/workspaces/" + workspaceID + "/plugins/private/install"
	if err := client.UploadPrivatePlugin(ctx, path, archive, artifact.Manifest.Metadata.Key+"-"+artifact.Manifest.Metadata.Version+".zip", &result); err != nil {
		return fmt.Errorf("install Private Plugin: %w", err)
	}
	output, _ := cmd.Flags().GetString("output")
	if output == "json" {
		return cli.PrintJSON(cmd.OutOrStdout(), result)
	}
	return printPluginRows(cmd, []map[string]any{result})
}

func fetchPrivatePlugins(cmd *cobra.Command) ([]map[string]any, error) {
	workspaceID, err := pluginWorkspaceID(cmd)
	if err != nil {
		return nil, err
	}
	client, err := newAPIClient(cmd)
	if err != nil {
		return nil, err
	}
	client.WorkspaceID = workspaceID

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Read the wrapped HTTP error — a 4xx names the server-side reason (conflict, forbidden, invalid artifact); act on that first.
  2. Bump the version in plugin.yaml, re-pack, and reinstall if the server reports a version conflict.
  3. For timeout ('context deadline exceeded'), raise MULTICA_HTTP_TIMEOUT (honored via AtLeastAPITimeout) or reduce archive size.
  4. Re-login if the token expired, then retry the install.

Example fix

// before
multica plugin install ./plugin.zip   // install Private Plugin: 409 version 0.1.0 already installed

// after: bump plugin.yaml version to 0.1.1, repack, install
multica plugin pack ./my-plugin --output ./plugin.zip
multica plugin install ./plugin.zip
Defensive patterns

Strategy: retry

Validate before calling

fi, err := os.Stat(source)
if err == nil && fi.Size() > plugincontract.MaxArchiveSize { /* abort before upload */ }

Try / catch

err := installCmd.Run()
if err != nil {
    msg := err.Error()
    switch {
    case strings.Contains(msg, "409"): // version conflict -> bump + repack
    case strings.Contains(msg, "context deadline exceeded"): // raise MULTICA_HTTP_TIMEOUT, retry once
    case strings.Contains(msg, "401"): // re-login, retry once
    default: return err
    }
}

Prevention

When it happens

Trigger: Server rejects the artifact (duplicate key/version, contract mismatch, workspace quota); token lacks install permission; upload exceeds the 1-minute ctx timeout on slow links; server unreachable mid-request.

Common situations: Reinstalling an identical version the server already tracks; uploading from a high-latency connection with a zip near MaxArchiveSize; MULTICA_HTTP_TIMEOUT raised but the hard 1-minute install cap still binding; expired login token.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/0d59b6357e183d23. Report an issue: GitHub.