influxdata/influxdb · error · syn::Error

expected an argument name

Error message

expected an argument name

What it means

When parsing a `name = value` attribute argument, the macro extracts the key as a single identifier. A multi-segment path key like `some::key = v` cannot be a single ident, so the macro rejects it with this error.

Solutions

  1. Use a plain single-word key: id, shape, or flags
  2. Remove any `::` or `.` from the argument name

Example fix

// before
#[catalog(record::id = record_ids::MyRecord)]
// after
#[catalog(id = record_ids::MyRecord)]
Defensive patterns

Strategy: validation

Validate before calling

// Argument keys must be plain identifiers, not paths:
// bad:  #[catalog(my::id = record_ids::X)]
// good: #[catalog(id = record_ids::X)]

Prevention

When it happens

Trigger: Using a qualified path as an argument name, e.g. `#[catalog(my::id = 5)]` or `foo.bar = 1`, inside the macro attribute.

Common situations: Copy-pasting key names with module paths; IDE auto-completion inserting qualified names; misunderstanding that keys must be plain identifiers.

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/6554fa8097a81a17. Report an issue: GitHub.

Appendix: source

Thrown at influxdb3_catalog_macros/src/lib.rs:88

}

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();
                    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`",

View on GitHub (pinned to 06200ef96b)