multica-ai/multica · error

update user profile: %w

Error message

update user profile: %w

What it means

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).

Source

Thrown at server/cmd/multica/cmd_user.go:124

	}

	if clearFlag {
		desc = ""
	}

	body := map[string]any{"profile_description": desc}

	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	var me map[string]any
	if err := client.PatchJSON(ctx, "/api/me", body, &me); err != nil {
		return fmt.Errorf("update user profile: %w", err)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "json" {
		return cli.PrintJSON(os.Stdout, me)
	}

	printUserProfileTable(os.Stdout, me)
	return nil
}

func printUserProfileTable(out *os.File, me map[string]any) {
	w := tabwriter.NewWriter(out, 0, 4, 2, ' ', 0)
	defer w.Flush()

	fmt.Fprintf(w, "ID\t%s\n", strVal(me, "id"))
	fmt.Fprintf(w, "NAME\t%s\n", strVal(me, "name"))
	fmt.Fprintf(w, "EMAIL\t%s\n", strVal(me, "email"))

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Inspect the wrapped error text: 401 → `multica login`; 400 → shorten/fix the description payload.
  2. Confirm server health with `multica status` and retry.
  3. For very long descriptions, prefer --description-file over shell quoting to avoid truncation surprises.
Defensive patterns

Strategy: try-catch

Validate before calling

multica status >/dev/null 2>&1 || { echo 'server unreachable'; exit 1; }

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: Long bios pasted from editors exceeding a server cap, tokens invalidated by logging in elsewhere, local daemon restarted mid-script.

Related errors


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