influxdata/influxdb · error · syn::Error
duplicate `flags`
Error message
duplicate `flags`
What it means
Compile-time error from the influxdb3_catalog_macros attribute parser: the `flags = <int>` key appears more than once in the macro invocation's attribute list. During `parse`, each recognized key is written into a slot Option, and a repeat assignment triggers this syn::Error at the duplicate key's span. It is a syntax-validation guard over macro input, not a runtime catalog error; resolve by specifying `flags` at most once.
Solutions
- Keep one `flags = ...` and merge the intended values into a single expression
- Delete the redundant flags entry
Example fix
// before #[catalog(id = record_ids::X, shape = 0x1, flags = A, flags = B)] // after #[catalog(id = record_ids::X, shape = 0x1, flags = A | B)]
Defensive patterns
Strategy: validation
Validate before calling
// Exactly one flags argument per attribute; merge values instead: // bad: flags = A, flags = B // good: flags = A | B
Prevention
- Merge flag values into a single expression
- Never append a second flags entry when combining examples
When it happens
Trigger: Writing `#[catalog(id = ..., flags = FOO, flags = BAR)]` in the same attribute.
Common situations: Combining flags from two examples without merging values; generated attributes appending defaults when flags already exist.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- duplicate `id`
- duplicate `shape`
- expected an argument name
- expected `name = value`; supported arguments are `id`…
- missing `id = record_ids::SOME_CONST`
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/324f96ef5e6e9165.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_catalog_macros/src/lib.rs:115
"shape" => {
let span = nv.value.span();
let Expr::Lit(syn::ExprLit {
lit: syn::Lit::Int(lit),
..
}) = nv.value
else {
return Err(syn::Error::new(
span,
"`shape` must be an integer literal, e.g. `shape = 0xbba17476`",
));
};
if shape.replace(lit).is_some() {
return Err(syn::Error::new(nv.path.span(), "duplicate `shape`"));
}
}
"flags" => {
if flags.replace(nv.value).is_some() {
return Err(syn::Error::new(nv.path.span(), "duplicate `flags`"));
}
}
other => {
return Err(syn::Error::new(
nv.path.span(),
format!(
"unknown argument `{other}`; supported arguments are `id`, `shape`, `flags`"
),
));
}
}
}
let id = id.ok_or_else(|| {
syn::Error::new(
proc_macro2::Span::call_site(),
"missing `id = record_ids::SOME_CONST`",
)View on GitHub (pinned to 06200ef96b)