multica-ai/multica · error

get issue: %w

Error message

get issue: %w

What it means

Returned by `fetchIssuePropertyBag` when the GET to `/api/issues/<issueID>` fails while fetching an issue's properties map. The %w wrap exposes the HTTP cause; note the issueID used is the already-resolved ID, so this is purely a transport/authorization/404 failure, not ref resolution.

Source

Thrown at server/cmd/multica/cmd_property.go:562

		}
		rows = append(rows, issuePropertyValueRow{
			PropertyID: p.ID,
			Name:       p.Name,
			Type:       p.Type,
			Value:      value,
			Display:    formatIssuePropertyValue(p, value),
			Archived:   p.Archived,
		})
	}
	return rows
}

func fetchIssuePropertyBag(ctx context.Context, client *cli.APIClient, issueID string) (map[string]any, error) {
	var issue struct {
		Properties map[string]any `json:"properties"`
	}
	if err := client.GetJSON(ctx, "/api/issues/"+issueID, &issue); err != nil {
		return nil, fmt.Errorf("get issue: %w", err)
	}
	if issue.Properties == nil {
		return map[string]any{}, nil
	}
	return issue.Properties, nil
}

func printIssuePropertyRows(rows []issuePropertyValueRow) {
	headers := []string{"NAME", "VALUE", "TYPE"}
	tableRows := make([][]string, len(rows))
	for i, row := range rows {
		tableRows[i] = []string{row.Name, row.Display, row.Type}
	}
	cli.PrintTable(os.Stdout, headers, tableRows)
}

func runIssuePropertyList(cmd *cobra.Command, args []string) error {
	client, err := newAPIClient(cmd)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. If the wrapped error says 404, re-resolve the issue (`multica issue list`) — it was deleted or the ref is stale.
  2. 401/403 → refresh credentials / check workspace membership.
  3. Network failure → confirm the API URL and server health, then retry the command.

Example fix

// before
multica issue property list ISS-42
// error: get issue: request failed: 404 not found

// after
multica issue list | grep -i <summary>   # find the live issue ref
multica issue property list <live-ref>
Defensive patterns

Strategy: retry

Validate before calling

# bash: confirm the issue exists before reading its properties
multica issue list | grep -qw "${ISSUE%%-*}" || { echo "issue not visible" >&2; exit 1; }

Try / catch

if err := client.GetJSON(ctx, "/api/issues/"+issueID, &issue); err != nil {
    if isTransient(err) { // network/5xx: retry with backoff
        return retryGet(ctx, client, issueID, &issue)
    }
    return fmt.Errorf("get issue: %w", err)
}

Prevention

When it happens

Trigger: The issue was deleted between resolution and fetch, the token lost read access (401/403), or the server is unreachable — triggered by `issue property list/set/unset` flows that call this helper.

Common situations: Race in automation: issue moved/deleted mid-run; permission changes on the workspace; network blips or server restarts during long CLI scripts.

Related errors


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