cube-js/cube · error · syn::Error

unknown cuberpc::service argument

Error message

unknown cuberpc::service argument

What it means

A proc-macro parse error for the #[cuberpc::service] attribute: an argument key other than the recognized trace_guard was supplied in the attribute parentheses. The input at fault is the attribute argument list in the Rust source, so this is a compile-time authoring error, not a runtime one.

Source

Thrown at rust/cubestore/cuberpc/src/lib.rs:37

/// `trace_guard = <path>`: generate a `Traced<Service>` decorator that wraps an
/// `Arc<dyn Service>` and, for every async method, holds the guard returned by
/// `<path>(method_name)` across the call. Keeps cuberpc decoupled from the host
/// crate's tracing module.
struct ServiceArgs {
    trace_guard: Option<syn::Path>,
}

impl Parse for ServiceArgs {
    fn parse(input: ParseStream) -> syn::Result<Self> {
        let mut trace_guard = None;
        if !input.is_empty() {
            let key: Ident = input.parse()?;
            input.parse::<syn::Token![=]>()?;
            let path: syn::Path = input.parse()?;
            if key == "trace_guard" {
                trace_guard = Some(path);
            } else {
                return Err(syn::Error::new(
                    key.span(),
                    "unknown cuberpc::service argument",
                ));
            }
        }
        Ok(ServiceArgs { trace_guard })
    }
}

struct RpcService {
    ident: Ident,
    methods: Vec<RpcMethod>,
    trace_guard: Option<syn::Path>,
}

struct RpcMethod {
    ident: Ident,
    asyncness: bool,

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Use only the supported attribute argument, e.g. #[cuberpc::service(trace_guard = my_path::trace_guard)]
  2. Remove the unrecognized key from the attribute
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at rust/cubestore/cuberpc/src/lib.rs:37 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/ceeed44dcc3e2f4a. Report an issue: GitHub.