multica-ai/multica · error

--metadata key %q given more than once; combine into a singl

Error message

--metadata key %q given more than once; combine into a single filter

What it means

Error "--metadata key %q given more than once; combine into a single filter" thrown in multica-ai/multica.

Source

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

// flags into the canonical JSON object passed as the `metadata` query
// parameter to /api/issues. Values are typed by the same rules as
// `metadata set --value` without --type — JSON-parsed when possible, else
// taken as a literal string. Duplicate keys are rejected; AND semantics
// require distinct keys.
func buildMetadataFilterQueryParam(pairs []string) (string, error) {
	if len(pairs) == 0 {
		return "", nil
	}
	out := make(map[string]any, len(pairs))
	for _, pair := range pairs {
		idx := strings.IndexByte(pair, '=')
		if idx <= 0 {
			return "", fmt.Errorf("--metadata %q must be in key=value form", pair)
		}
		key := pair[:idx]
		raw := pair[idx+1:]
		if _, dup := out[key]; dup {
			return "", fmt.Errorf("--metadata key %q given more than once; combine into a single filter", key)
		}
		encoded, err := parseMetadataValue(raw, "")
		if err != nil {
			return "", fmt.Errorf("--metadata %s: %w", key, err)
		}
		var v any
		if err := json.Unmarshal(encoded, &v); err != nil {
			return "", fmt.Errorf("--metadata %s: encode value: %w", key, err)
		}
		out[key] = v
	}
	buf, err := json.Marshal(out)
	if err != nil {
		return "", fmt.Errorf("encode metadata filter: %w", err)
	}
	return string(buf), nil
}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Combine duplicate metadata keys into a single filter.

When it happens

Trigger: Thrown at server/cmd/multica/cmd_issue_metadata.go:38 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/0824d9d0fe7184bb. Report an issue: GitHub.