influxdata/influxdb · error · syn::Error

expected `name = value`; supported arguments are `id`…

Error message

expected `name = value`; supported arguments are `id`, `shape`, `flags`

What it means

This proc macro parses attribute arguments strictly as `name = value` pairs. If it encounters a Meta item that is not NameValue (e.g. a bare path like `#[catalog(..., foo)]` or a list `foo(...)`), it emits this error pointing at that argument.

Solutions

  1. Give every argument a value: write `id = record_ids::X`, `shape = 0x…`, `flags = …`
  2. Remove any bare/positional arguments that are not `name = value` pairs
  3. Only use the supported keys id, shape, flags

Example fix

// before
#[catalog(id, shape = 0xbba17476)]
// after
#[catalog(id = record_ids::MyRecord, shape = 0xbba17476)]
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check each attribute argument is `name = value`
// bad:  #[catalog(id, shape = 0x1)]
// good: #[catalog(id = record_ids::X, shape = 0x1)]

Prevention

When it happens

Trigger: Writing an attribute argument without a value, e.g. `#[catalog(id, shape = 0x1)]`, or passing a list-style argument `flags(debug)` instead of `flags = ...`.

Common situations: Copy-pasting attribute syntax from other crates that accept bare flags; typos omitting the `= value` part; confusion between flag-style and key-value style macro attributes.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/65e5950905c180ca. Report an issue: GitHub.

Appendix: source

Thrown at influxdb3_catalog_macros/src/lib.rs:80

}

/// Parsed `#[catalog_record(..)]` arguments.
struct Args {
    id: Expr,
    shape: u32,
    shape_span: proc_macro2::Span,
    flags: Option<Expr>,
}

impl Args {
    fn parse(metas: Punctuated<Meta, Token![,]>) -> syn::Result<Self> {
        let mut id = None;
        let mut shape = None;
        let mut flags = None;

        for meta in metas {
            let Meta::NameValue(nv) = meta else {
                return Err(syn::Error::new(
                    meta.span(),
                    "expected `name = value`; supported arguments are `id`, `shape`, `flags`",
                ));
            };
            let key = nv
                .path
                .get_ident()
                .ok_or_else(|| syn::Error::new(nv.path.span(), "expected an argument name"))?
                .to_string();

            match key.as_str() {
                "id" => {
                    if id.replace(nv.value).is_some() {
                        return Err(syn::Error::new(nv.path.span(), "duplicate `id`"));
                    }
                }
                "shape" => {
                    let span = nv.value.span();

View on GitHub (pinned to 06200ef96b)