multica-ai/multica · error

key not found on issue

Error message

key %q not found on issue

What it means

Key-presence guard in runIssueMetadataGet: the metadata map was fetched successfully but the requested --key is not present on the issue. This distinguishes "issue exists but has no such key" from transport failures, telling the user explicitly which key was missing rather than printing empty output.

Solutions

  1. Check the key spelling; list metadata to see available keys.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/cmd/multica/cmd_issue_metadata.go:238 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at server/cmd/multica/cmd_issue_metadata.go:238

	if err != nil {
		return err
	}
	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	issueRef, err := resolveIssueRef(ctx, client, args[0])
	if err != nil {
		return fmt.Errorf("resolve issue: %w", err)
	}

	var result map[string]any
	if err := client.GetJSON(ctx, "/api/issues/"+issueRef.ID+"/metadata", &result); err != nil {
		return fmt.Errorf("get metadata: %w", err)
	}
	metadata, _ := result["metadata"].(map[string]any)
	value, present := metadata[key]
	if !present {
		return fmt.Errorf("key %q not found on issue", key)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "json" {
		return cli.PrintJSON(os.Stdout, value)
	}
	headers := []string{"KEY", "VALUE", "TYPE"}
	rows := [][]string{{key, formatMetadataValue(value), metadataValueType(value)}}
	cli.PrintTable(os.Stdout, headers, rows)
	return nil
}

func runIssueMetadataSet(cmd *cobra.Command, args []string) error {
	key, _ := cmd.Flags().GetString("key")
	if key == "" {
		return fmt.Errorf("--key is required")
	}
	if !cmd.Flags().Changed("value") {

View on GitHub (pinned to 2c0912b6ec)