{"record":{"id":"f9d366fb10ce94d0","repo":"multica-ai/multica","slug":"update-user-profile-w","errorCode":null,"errorMessage":"update user profile: %w","messagePattern":"update user profile: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_user.go","lineNumber":124,"sourceCode":"\t}\n\n\tif clearFlag {\n\t\tdesc = \"\"\n\t}\n\n\tbody := map[string]any{\"profile_description\": desc}\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 me map[string]any\n\tif err := client.PatchJSON(ctx, \"/api/me\", body, &me); err != nil {\n\t\treturn fmt.Errorf(\"update user profile: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, me)\n\t}\n\n\tprintUserProfileTable(os.Stdout, me)\n\treturn nil\n}\n\nfunc printUserProfileTable(out *os.File, me map[string]any) {\n\tw := tabwriter.NewWriter(out, 0, 4, 2, ' ', 0)\n\tdefer w.Flush()\n\n\tfmt.Fprintf(w, \"ID\\t%s\\n\", strVal(me, \"id\"))\n\tfmt.Fprintf(w, \"NAME\\t%s\\n\", strVal(me, \"name\"))\n\tfmt.Fprintf(w, \"EMAIL\\t%s\\n\", strVal(me, \"email\"))","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_user.go#L106-L142","documentation":"The PATCH /api/me issued by `multica user profile update` failed. The wrapped error from client.PatchJSON distinguishes transport failures (server unreachable) from HTTP failures (401 auth, 400 server-side validation such as description too long, 5xx).","triggerScenarios":"Running the update with a valid flag combination while the server rejects or cannot be reached: expired token, description exceeding a server-side length limit, or the server process being down between the flag validation and the request.","commonSituations":"Long bios pasted from editors exceeding a server cap, tokens invalidated by logging in elsewhere, local daemon restarted mid-script.","solutions":["Inspect the wrapped error text: 401 → `multica login`; 400 → shorten/fix the description payload.","Confirm server health with `multica status` and retry.","For very long descriptions, prefer --description-file over shell quoting to avoid truncation surprises."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"multica status >/dev/null 2>&1 || { echo 'server unreachable'; exit 1; }","typeGuard":null,"tryCatchPattern":"out=$(multica user profile update --description \"$DESC\" 2>&1) || { case \"$out\" in *401*|*unauthorized*) multica login && multica user profile update --description \"$DESC\" ;; *) echo \"$out\"; exit 1 ;; esac; }","preventionTips":["Validate description length client-side before sending (mirror the server cap).","Re-login proactively when tokens have a known TTL.","Use --description-file to avoid shell-quoting corruption of the payload."],"tags":["cli","api","auth","validation"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}