{"record":{"id":"0824d9d0fe7184bb","repo":"multica-ai/multica","slug":"metadata-key-q-given-more-than-once-combine-in","errorCode":null,"errorMessage":"--metadata key %q given more than once; combine into a single filter","messagePattern":"--metadata key %q given more than once; combine into a single filter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue_metadata.go","lineNumber":38,"sourceCode":"// flags into the canonical JSON object passed as the `metadata` query\n// parameter to /api/issues. Values are typed by the same rules as\n// `metadata set --value` without --type — JSON-parsed when possible, else\n// taken as a literal string. Duplicate keys are rejected; AND semantics\n// require distinct keys.\nfunc buildMetadataFilterQueryParam(pairs []string) (string, error) {\n\tif len(pairs) == 0 {\n\t\treturn \"\", nil\n\t}\n\tout := make(map[string]any, len(pairs))\n\tfor _, pair := range pairs {\n\t\tidx := strings.IndexByte(pair, '=')\n\t\tif idx <= 0 {\n\t\t\treturn \"\", fmt.Errorf(\"--metadata %q must be in key=value form\", pair)\n\t\t}\n\t\tkey := pair[:idx]\n\t\traw := pair[idx+1:]\n\t\tif _, dup := out[key]; dup {\n\t\t\treturn \"\", fmt.Errorf(\"--metadata key %q given more than once; combine into a single filter\", key)\n\t\t}\n\t\tencoded, err := parseMetadataValue(raw, \"\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"--metadata %s: %w\", key, err)\n\t\t}\n\t\tvar v any\n\t\tif err := json.Unmarshal(encoded, &v); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"--metadata %s: encode value: %w\", key, err)\n\t\t}\n\t\tout[key] = v\n\t}\n\tbuf, err := json.Marshal(out)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"encode metadata filter: %w\", err)\n\t}\n\treturn string(buf), nil\n}\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue_metadata.go#L20-L56","documentation":"Error \"--metadata key %q given more than once; combine into a single filter\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_issue_metadata.go:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Combine duplicate metadata keys into a single filter."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}