Hmbown/CodeWhale · error

Fleet alert adapter is not configured

Error message

Fleet alert adapter {} is not configured

What it means

The Fleet alert dispatcher routes an event to adapters by name using the configured routes. Each route's `adapter` must be a key present in `self.config.adapters`; a route referencing an unconfigured adapter is a misconfiguration, so dispatch fails rather than silently dropping the alert.

Solutions

  1. Add an adapter definition with the name referenced by the route to config.adapters.
  2. Fix the route's adapter field to match an existing adapter key exactly (check spelling/case).
  3. Remove the stale route if the adapter was intentionally retired.

Example fix

# before
routes:
  - class: build-failure
    adapter: slack-ops
# after: either rename the route adapter or define it
adapters:
  slack-ops:
    kind: webhook
    ...
Defensive patterns

Strategy: validation

Validate before calling

fn validate_alert_config(config: &FleetAlertsConfig) -> Result<()> {
    for route in &config.routes {
        anyhow::ensure!(
            config.adapters.contains_key(&route.adapter),
            "route references unconfigured adapter {}",
            route.adapter
        );
    }
    Ok(())
}

Try / catch

match dispatcher.dispatch(&event).await {
    Err(e) if e.to_string().contains("is not configured") => {
        log::warn!("alert dropped, adapter missing: {e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling `dispatch` on a Fleet alert dispatcher whose config contains a route whose `route.adapter` name has no matching entry in `config.adapters`.

Common situations: Typo in an adapter name in the routes section; an adapter definition removed or renamed while routes still reference the old name; YAML/TOML config indentation placing the adapter under the wrong key.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/1c6903006cd0047b. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/fleet/alerts.rs:133

    R: FleetAlertSecretResolver,
{
    pub fn new(config: FleetAlertConfig, resolver: R) -> Self {
        Self { config, resolver }
    }

    pub fn dispatch(&self, event: &FleetAlertEvent) -> Result<Vec<FleetAlertDelivery>> {
        if !self.config.enabled {
            return Ok(Vec::new());
        }
        let mut deliveries = Vec::new();
        for route in self
            .config
            .routes
            .iter()
            .filter(|route| route_matches(route, event.class))
        {
            let adapter = self.config.adapters.get(&route.adapter).ok_or_else(|| {
                anyhow!("Fleet alert adapter {} is not configured", route.adapter)
            })?;
            let prepared = prepare_alert(&route.adapter, adapter, event, self.config.dry_run)?;
            let sent = if self.config.dry_run {
                false
            } else {
                send_alert(adapter, &prepared.body, &self.resolver)?
            };
            deliveries.push(FleetAlertDelivery {
                adapter: route.adapter.clone(),
                event_class: event.class,
                dry_run: self.config.dry_run,
                sent,
                redacted_payload: prepared.redacted_payload,
            });
        }
        Ok(deliveries)
    }
}

View on GitHub (pinned to 73e0f67d83)