{"record":{"id":"1667305482a7db55","repo":"influxdata/influxdb","slug":"duplicate-id","errorCode":null,"errorMessage":"duplicate `id`","messagePattern":"duplicate `id`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog_macros/src/lib.rs","lineNumber":94,"sourceCode":"        let mut flags = None;\n\n        for meta in metas {\n            let Meta::NameValue(nv) = meta else {\n                return Err(syn::Error::new(\n                    meta.span(),\n                    \"expected `name = value`; supported arguments are `id`, `shape`, `flags`\",\n                ));\n            };\n            let key = nv\n                .path\n                .get_ident()\n                .ok_or_else(|| syn::Error::new(nv.path.span(), \"expected an argument name\"))?\n                .to_string();\n\n            match key.as_str() {\n                \"id\" => {\n                    if id.replace(nv.value).is_some() {\n                        return Err(syn::Error::new(nv.path.span(), \"duplicate `id`\"));\n                    }\n                }\n                \"shape\" => {\n                    let span = nv.value.span();\n                    let Expr::Lit(syn::ExprLit {\n                        lit: syn::Lit::Int(lit),\n                        ..\n                    }) = nv.value\n                    else {\n                        return Err(syn::Error::new(\n                            span,\n                            \"`shape` must be an integer literal, e.g. `shape = 0xbba17476`\",\n                        ));\n                    };\n                    if shape.replace(lit).is_some() {\n                        return Err(syn::Error::new(nv.path.span(), \"duplicate `shape`\"));\n                    }\n                }","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog_macros/src/lib.rs#L76-L112","documentation":"A compile-time proc-macro error raised by the catalog record attribute parser when the same attribute argument `id` appears more than once on a record definition; only one `id = ...` is allowed, so the macro aborts expansion.","triggerScenarios":"Writing `#[catalog(id = A, id = B, shape = ...)]` — two `id` arguments in one attribute.","commonSituations":"Merging two attribute examples and leaving both `id` lines; generating attributes programmatically and appending a default id; copy-paste duplication.","solutions":["Remove one of the duplicate `id = ...` entries","Keep exactly one `id = record_ids::SOME_CONST` per attribute"],"exampleFix":"// before\n#[catalog(id = record_ids::A, id = record_ids::B, shape = 0x1)]\n// after\n#[catalog(id = record_ids::A, shape = 0x1)]","handlingStrategy":"validation","validationCode":"fn check_no_dupes(args: &[&str]) -> Result<(), String> {\n    let mut seen = std::collections::HashSet::new();\n    for a in args {\n        if !seen.insert(a) { return Err(format!(\"duplicate argument `{a}`\")); }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Specify each attribute argument at most once","When merging examples, deduplicate keys","Lint macro attribute usage in code review"],"tags":["rust","proc-macro","duplicate-argument","attribute"],"backgroundTag":"conflicting-config-options","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}