{"record":{"id":"0d59b6357e183d23","repo":"multica-ai/multica","slug":"install-private-plugin-w","errorCode":null,"errorMessage":"install Private Plugin: %w","messagePattern":"install Private Plugin: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_plugin.go","lineNumber":241,"sourceCode":"\tarchive, artifact, err := loadPluginSource(args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"validate Plugin before install: %w\", err)\n\t}\n\tworkspaceID, err := pluginWorkspaceID(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclient.WorkspaceID = workspaceID\n\tctx, cancel := context.WithTimeout(context.Background(), cli.AtLeastAPITimeout(time.Minute))\n\tdefer cancel()\n\tvar result map[string]any\n\tpath := \"/api/workspaces/\" + workspaceID + \"/plugins/private/install\"\n\tif err := client.UploadPrivatePlugin(ctx, path, archive, artifact.Manifest.Metadata.Key+\"-\"+artifact.Manifest.Metadata.Version+\".zip\", &result); err != nil {\n\t\treturn fmt.Errorf(\"install Private Plugin: %w\", err)\n\t}\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(cmd.OutOrStdout(), result)\n\t}\n\treturn printPluginRows(cmd, []map[string]any{result})\n}\n\nfunc fetchPrivatePlugins(cmd *cobra.Command) ([]map[string]any, error) {\n\tworkspaceID, err := pluginWorkspaceID(cmd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient.WorkspaceID = workspaceID","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_plugin.go#L223-L259","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the wrapped HTTP error — a 4xx names the server-side reason (conflict, forbidden, invalid artifact); act on that first.","Bump the version in plugin.yaml, re-pack, and reinstall if the server reports a version conflict.","For timeout ('context deadline exceeded'), raise MULTICA_HTTP_TIMEOUT (honored via AtLeastAPITimeout) or reduce archive size.","Re-login if the token expired, then retry the install."],"exampleFix":"// before\nmultica plugin install ./plugin.zip   // install Private Plugin: 409 version 0.1.0 already installed\n\n// after: bump plugin.yaml version to 0.1.1, repack, install\nmultica plugin pack ./my-plugin --output ./plugin.zip\nmultica plugin install ./plugin.zip","handlingStrategy":"retry","validationCode":"fi, err := os.Stat(source)\nif err == nil && fi.Size() > plugincontract.MaxArchiveSize { /* abort before upload */ }","typeGuard":null,"tryCatchPattern":"err := installCmd.Run()\nif err != nil {\n    msg := err.Error()\n    switch {\n    case strings.Contains(msg, \"409\"): // version conflict -> bump + repack\n    case strings.Contains(msg, \"context deadline exceeded\"): // raise MULTICA_HTTP_TIMEOUT, retry once\n    case strings.Contains(msg, \"401\"): // re-login, retry once\n    default: return err\n    }\n}","preventionTips":["Bump plugin version on every code change so installs never conflict.","Raise MULTICA_HTTP_TIMEOUT for large archives on slow links.","Run install only after validate passes locally to keep retries cheap."],"tags":["cli","plugin","upload","network","timeout","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}