{"record":{"id":"5c0f949c83f50399","repo":"multica-ai/multica","slug":"update-workspace-w","errorCode":null,"errorMessage":"update workspace: %w","messagePattern":"update workspace: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_workspace.go","lineNumber":599,"sourceCode":"\tbody, err := buildWorkspaceUpdateBody(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(body) == 0 {\n\t\treturn fmt.Errorf(\"no fields to update; use --name, --description, --context, or --issue-prefix\")\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar ws map[string]any\n\tif err := client.PatchJSON(ctx, \"/api/workspaces/\"+wsID, body, &ws); err != nil {\n\t\treturn fmt.Errorf(\"update workspace: %w\", err)\n\t}\n\n\treturn printWorkspace(cmd, ws)\n}\n\nfunc runWorkspaceMcpList(cmd *cobra.Command, args []string) error {\n\twsID, err := resolveWorkspaceArg(cmd, args)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif wsID == \"\" {\n\t\treturn fmt.Errorf(\"workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID\")\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_workspace.go#L581-L617","documentation":"Wrapped failure of the HTTP PATCH to /api/workspaces/{id} performed by `multica workspace update`. The underlying cause — validation rejection (400), unknown workspace (404), auth failure (401/403), conflict (409, e.g. slug or prefix already taken), or network error — is preserved via %w.","triggerScenarios":"Updating a workspace with an invalid new name/slug/prefix (server-side 400), a duplicate issue-prefix (409), a nonexistent id/slug, insufficient member role, or an unreachable server.","commonSituations":"Trying to set an issue prefix another workspace already owns; renaming to a reserved or malformed slug; stale identifier after the workspace was deleted; read-only member attempting an update.","solutions":["Read the wrapped error text — the server's status code and message identify whether it is validation (400), not-found (404), or conflict (409)","For 400/409, adjust the field values (e.g. pick a unique issue-prefix) and re-run","For 404, resolve the current identifier via `multica workspace list`","For 401/403, fix the token or use an account with owner/admin role on the workspace"],"exampleFix":"# before\nmultica workspace update acme --issue-prefix MULT\n# update workspace: 409 issue prefix already in use\n\n# after\nmultica workspace update acme --issue-prefix ACM","handlingStrategy":"try-catch","validationCode":"if len(body) == 0 {\n    return errors.New(\"nothing to update\")\n}\n// pre-validate unique-ish values client-side to reduce 409s\nif p, ok := body[\"issue_prefix\"].(string); ok && len(p) > 8 {\n    return errors.New(\"issue prefix too long; pick a shorter one\")\n}","typeGuard":null,"tryCatchPattern":"if err := client.PatchJSON(ctx, path, body, &ws); err != nil {\n    var httpErr *apiclient.HTTPError\n    if errors.As(err, &httpErr) {\n        if httpErr.StatusCode == 409 {\n            // pick another value and let the caller retry once\n            return retryWithNewPrefix(body)\n        }\n    }\n    return fmt.Errorf(\"update workspace: %w\", err)\n}","preventionTips":["Prefer unique issue prefixes per workspace to avoid 409 conflicts","Re-resolve slugs via `workspace list` before updating in long-lived scripts","Run updates with a token that has owner/admin role on the workspace"],"tags":["cli","http","workspace","api-client"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}