{"record":{"id":"b8e01a078ab2cd83","repo":"block/buzz","slug":"duplicate-system-argument","errorCode":null,"errorMessage":"duplicate `system` argument","messagePattern":"duplicate `system` argument","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/buzz-datastore-tracing/src/lib.rs","lineNumber":35,"sourceCode":"impl Parse for DatastoreArgs {\n    fn parse(input: ParseStream<'_>) -> Result<Self> {\n        let mut name = None;\n        let mut system = None;\n        let mut fields = None;\n\n        while !input.is_empty() {\n            let key: Ident = input.parse()?;\n            match key.to_string().as_str() {\n                \"name\" => {\n                    if name.is_some() {\n                        return Err(Error::new(key.span(), \"duplicate `name` argument\"));\n                    }\n                    input.parse::<Token![=]>()?;\n                    name = Some(input.parse()?);\n                }\n                \"system\" => {\n                    if system.is_some() {\n                        return Err(Error::new(key.span(), \"duplicate `system` argument\"));\n                    }\n                    input.parse::<Token![=]>()?;\n                    system = Some(input.parse()?);\n                }\n                \"fields\" => {\n                    if fields.is_some() {\n                        return Err(Error::new(key.span(), \"duplicate `fields` argument\"));\n                    }\n                    let content;\n                    parenthesized!(content in input);\n                    fields = Some(content.parse()?);\n                }\n                _ => {\n                    return Err(Error::new(\n                        key.span(),\n                        \"expected `name`, `system`, or `fields`\",\n                    ))\n                }","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/block/buzz/blob/eed74bde2f4797714335ac10c56c0b0244c1def4/crates/buzz-datastore-tracing/src/lib.rs#L17-L53","documentation":"Same Parse impl as the duplicate-name check, guarding the `system` key of #[datastore_span]: a second system = \"...\" argument is rejected at the duplicate key's span with 'duplicate `system` argument'. Compile-time only; the macro additionally requires system == \"postgresql\" once parsed (unsupported values are a separate error).","triggerScenarios":"#[datastore_span(name = \"x\", system = \"postgresql\", system = \"postgresql\")] — the second system key trips the check at crates/buzz-datastore-tracing/src/lib.rs:34-36. Typical after a bad merge or a copy-paste where someone 'clarified' the system twice.","commonSituations":"Merge conflicts on annotated datastore functions; refactoring that moved attributes around and re-added system; scripted codemods appending arguments instead of replacing them.","solutions":["Remove the duplicated `system = ...` entry, keeping exactly one (and value \"postgresql\" — the only supported system).","Re-run `cargo check` on the failing crate to verify.","Prefer `just fix-all`/fmt only after the syntax is valid — the compile error blocks everything downstream."],"exampleFix":"// before\n#[datastore_span(name = \"insert_event\", system = \"postgresql\", system = \"postgres\")]\n\n// after\n#[datastore_span(name = \"insert_event\", system = \"postgresql\")]","handlingStrategy":"validation","validationCode":"// compile-time only: `cargo check -p buzz-db` reports the duplicate `system` span","typeGuard":null,"tryCatchPattern":null,"preventionTips":["system is always \"postgresql\" today — a linter/grep for `system = \"` beyond one per attribute catches drift.\n        rg '#\\[datastore_span' -A2 crates/buzz-db/src","Resolve attribute merge conflicts by taking one side entirely, not concatenating both.","Keep `cargo check` in the pre-push flow so macro parse errors never land on CI as a surprise."],"tags":["rust","proc-macro","compile-error","tracing","macro-arguments"],"backgroundTag":"duplicate-macro-argument","analyzedSha":"eed74bde2f4797714335ac10c56c0b0244c1def4","analyzedAt":"2026-08-20T04:38:24.874Z","contentChangedAt":"2026-08-20T04:38:24.874Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}