zeroclaw-labs/zeroclaw · error · anyhow::Error

Gmail Push channel requires the `channel-email` feature

Error message

Gmail Push channel requires the `channel-email` feature

What it means

Raised by build_channel_by_id when the channel id is "gmail_push" or "gmail-push" and the binary lacks the `channel-email` feature. Gmail Push shares the email feature rather than having its own: it is built from config.channels.gmail_push in the channel-email-gated arm. Both spellings are one arm, so either id yields this bail naming `channel-email`, which can surprise operators expecting a gmail-specific feature.

Source

Thrown at crates/zeroclaw-channels/src/orchestrator/mod.rs:9477

                .channels
                .gmail_push
                .get("default")
                .context("Gmail Push channel is not configured")?;
            let alias = "default".to_string();
            let peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync> = {
                let cfg_arc = config_arc.clone();
                let alias = alias.clone();
                Arc::new(move || cfg_arc.read().channel_external_peers("gmail_push", &alias))
            };
            Ok(Arc::new(GmailPushChannel::new(
                gp.clone(),
                alias,
                peer_resolver,
            )))
        }
        #[cfg(not(feature = "channel-email"))]
        "gmail_push" | "gmail-push" => {
            anyhow::bail!("Gmail Push channel requires the `channel-email` feature");
        }
        #[cfg(feature = "channel-irc")]
        "irc" => {
            let irc_cfg = config
                .channels
                .irc
                .get("default")
                .context("IRC channel is not configured")?;
            let alias = "default".to_string();
            let peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync> = {
                let cfg_arc = config_arc.clone();
                let alias = alias.clone();
                Arc::new(move || cfg_arc.read().channel_external_peers("irc", &alias))
            };
            Ok(Arc::new(IrcChannel::new(crate::irc::IrcChannelConfig {
                server: irc_cfg.server.clone(),
                port: irc_cfg.port,
                nickname: irc_cfg.nickname.clone(),

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Rebuild with --features channel-email (there is no separate gmail feature; email is in default-channels, so dropping --no-default-features also works)
  2. Or remove the [channels.gmail_push] block and "gmail_push"/"gmail-push" bindings
  3. Pre-check zeroclaw_channels::listing::is_channel_type_compiled("gmail_push")

Example fix

# before
 cargo build --release --no-default-features

 # after
 cargo build --release --no-default-features --features channel-email
Defensive patterns

Strategy: validation

Validate before calling

use zeroclaw_channels::listing::is_channel_type_compiled;

if !is_channel_type_compiled("gmail_push") {
    eprintln!("gmail_push shares the channel-email feature; rebuild with --features channel-email");
}

Type guard

fn gmail_push_available() -> bool {
    zeroclaw_channels::listing::is_channel_type_compiled("gmail_push")
}

Try / catch

match build_channel_by_id(&config_arc, "gmail-push") {
    Ok(ch) => { /* use */ }
    Err(e) if e.to_string().contains("requires the `channel-email` feature") => {
        // note: there is no gmail-specific feature; enable channel-email
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: start_channels / build_channel_by_id with channel_id "gmail_push" or "gmail-push" while compiled without channel-email — e.g. a --no-default-features build, since channel-email is otherwise on by default.

Common situations: Same as the email channel: reduced-feature builds. Additionally, operators grep Cargo features for "gmail", find none, and get stuck — the fix is the shared channel-email feature; Pub/Sub credential setup in [channels.gmail_push] is irrelevant to this error.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/85eac78ebf13c774. Report an issue: GitHub.