multica-ai/multica · error

list projects: %w

Error message

list projects: %w

What it means

Wrap in the `multica project list` handler (cmd_project.go:224): the GET /api/projects request (with optional query params like status) via client.GetJSON failed. Covers transport errors, auth failures (401/403), server 5xx, and JSON decode failures of the expected map payload.

Source

Thrown at server/cmd/multica/cmd_project.go:224

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

	params := url.Values{}
	if client.WorkspaceID != "" {
		params.Set("workspace_id", client.WorkspaceID)
	}
	if v, _ := cmd.Flags().GetString("status"); v != "" {
		params.Set("status", v)
	}

	path := "/api/projects"
	if len(params) > 0 {
		path += "?" + params.Encode()
	}

	var result map[string]any
	if err := client.GetJSON(ctx, path, &result); err != nil {
		return fmt.Errorf("list projects: %w", err)
	}

	projectsRaw, _ := result["projects"].([]any)

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

	fullID, _ := cmd.Flags().GetBool("full-id")
	actors := loadActorDisplayLookup(ctx, client)
	headers := []string{"ID", "TITLE", "STATUS", "LEAD", "CREATED"}
	rows := make([][]string, 0, len(projectsRaw))
	for _, raw := range projectsRaw {
		p, ok := raw.(map[string]any)
		if !ok {
			continue
		}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Confirm auth: re-run login / check token validity (curl the endpoint with the same bearer token).
  2. Verify the server is up and the URL is correct.
  3. If a --status filter is set, make sure it is a valid server-side status (see error 575's enum).
  4. Check server logs for 5xx details if the wrapped error shows 500.

Example fix

# before
multica project list --status done   # may 4xx server-side or auth may be stale

# after
multica login
multica project list --status completed
Defensive patterns

Strategy: retry

Validate before calling

if err := pingServer(cfg.ServerURL); err != nil { return fmt.Errorf("server down: %w", err) }
if status != "" && !isValidProjectStatus(status) { return fmt.Errorf("bad filter") }

Try / catch

if err := listCmd.Run(); err != nil {
    if isAuthErr(err) { relogin(); retry once }
    if isTransient(err) { retry with backoff }
}

Prevention

When it happens

Trigger: GET /api/projects?status=... returning non-2xx; expired token; server not running; response shape not a JSON object (decode error).

Common situations: Token expired since last use; pointing at a server of an older API version; filtering by a status the server rejects; network/VPN down.

Related errors


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