{"record":{"id":"afbb1c7f43a81eff","repo":"multica-ai/multica","slug":"get-user-profile-w","errorCode":null,"errorMessage":"get user profile: %w","messagePattern":"get user profile: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_user.go","lineNumber":78,"sourceCode":"\tuserProfileUpdateCmd.Flags().Bool(\"description-stdin\", false, \"Read description from stdin (preserves multi-line content verbatim)\")\n\tuserProfileUpdateCmd.Flags().String(\"description-file\", \"\", \"Read description from a UTF-8 file (preserves multi-line content verbatim; use this on Windows when stdin piping mangles non-ASCII bytes). The path must be inside the current working directory unless --allow-external-file is set.\")\n\tuserProfileUpdateCmd.Flags().Bool(\"allow-external-file\", false, \"Allow --description-file to read a path outside the current working directory. Off by default so a stale temp file from another run/environment can't be picked up (MUL-4252).\")\n\tuserProfileUpdateCmd.Flags().Bool(\"clear\", false, \"Clear the profile description (equivalent to --description \\\"\\\")\")\n\tuserProfileUpdateCmd.Flags().String(\"output\", \"table\", \"Output format: table or json\")\n}\n\nfunc runUserProfileGet(cmd *cobra.Command, _ []string) error {\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.GetJSON(ctx, \"/api/me\", &me); err != nil {\n\t\treturn fmt.Errorf(\"get 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 runUserProfileUpdate(cmd *cobra.Command, _ []string) error {\n\t// `--clear` is its own flag (not \"pass an empty string\") because cobra's\n\t// default value for a Changed(\"\") flag would otherwise be ambiguous with\n\t// \"user typed `--description \"\"`\". Keep both forms supported — the inline\n\t// empty string is what someone scripting bash would reach for.\n\tclearFlag, _ := cmd.Flags().GetBool(\"clear\")\n\tdesc, hasDesc, err := resolveTextFlag(cmd, \"description\")","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_user.go#L60-L96","documentation":"The `multica user profile get` command failed its GET /api/me request through the shared API client. The wrapped error identifies whether this is transport-level (server unreachable, bad server URL) or HTTP-level (401 expired token, 5xx), since the client prefixes those differently.","triggerScenarios":"Running `multica user profile get` when the daemon/server at the resolved URL is not running, the stored auth token is expired/revoked (401), or a proxy in between mangles the request.","commonSituations":"Server not started yet in local dev, stale token after a server DB reset or re-login elsewhere, wrong --server flag or MULTICA_SERVER env pointing at an old port.","solutions":["Confirm the server is up: `multica status` or curl the /api/me endpoint of the resolved server URL.","If the wrapped error mentions 401/unauthorized, re-authenticate with `multica login`.","Verify --server / server env resolves to the intended instance (see daemonPortOnlyContextHint output elsewhere for port mismatches).","Retry after the server reports healthy; treat 5xx as transient."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"multica status >/dev/null 2>&1 || { echo 'server not reachable'; exit 1; }","typeGuard":null,"tryCatchPattern":"out=$(multica user profile get --output json 2>&1) || { case \"$out\" in *unauthorized*|*401*) multica login ;; *) echo \"$out\"; exit 1 ;; esac; }","preventionTips":["Run `multica login` before any /api/me-dependent command in scripts.","Check `multica status` first to fail fast on a down server.","Wrap profile reads with --output json for machine-parseable results and stable error handling."],"tags":["cli","api","auth","network"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}