zeroclaw-labs/zeroclaw · error

cloud_ops.default_cloud '{}' is not in cloud_ops.supported_c

Error message

cloud_ops.default_cloud '{}' is not in cloud_ops.supported_clouds {:?}

What it means

The enabled cloud_ops module must be internally consistent: `default_cloud` must be an exact, case-sensitive member of `supported_clouds`. The check is a plain `Vec::contains`, so both mismatched values and case differences (`"AWS"` vs `"aws"`) fail, including the common shape where the list was narrowed but the default was left at `"aws"`.

Source

Thrown at crates/zeroclaw-config/src/schema.rs:18587

                    "cloud_ops.default_cloud must not be empty when cloud_ops is enabled"
                );
            }
            if self.supported_clouds.is_empty() {
                anyhow::bail!(
                    "cloud_ops.supported_clouds must not be empty when cloud_ops is enabled"
                );
            }
            for (i, cloud) in self.supported_clouds.iter().enumerate() {
                if cloud.trim().is_empty() {
                    validation_bail!(
                        RequiredFieldEmpty,
                        format!("cloud_ops.supported_clouds[{i}]"),
                        "cloud_ops.supported_clouds[{i}] must not be empty"
                    );
                }
            }
            if !self.supported_clouds.contains(&self.default_cloud) {
                anyhow::bail!(
                    "cloud_ops.default_cloud '{}' is not in cloud_ops.supported_clouds {:?}",
                    self.default_cloud,
                    self.supported_clouds
                );
            }
            if self.cost_threshold_monthly_usd < 0.0 {
                anyhow::bail!(
                    "cloud_ops.cost_threshold_monthly_usd must be non-negative, got {}",
                    self.cost_threshold_monthly_usd
                );
            }
            if self.iac_tools.is_empty() {
                anyhow::bail!("cloud_ops.iac_tools must not be empty when cloud_ops is enabled");
            }
        }
        Ok(())
    }
}

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set `default_cloud` to one of the exact strings in `supported_clouds`.
  2. Or add the intended default to `supported_clouds`.
  3. Check for case and hidden whitespace differences between the two values.

Example fix

# before
default_cloud = "aws"
supported_clouds = ["gcp"]

# after
default_cloud = "gcp"
supported_clouds = ["gcp"]
Defensive patterns

Strategy: validation

Validate before calling

anyhow::ensure!(
    !cloud_ops.enabled || cloud_ops.supported_clouds.contains(&cloud_ops.default_cloud),
    "default_cloud must be an exact member of supported_clouds"
);

Type guard

fn default_cloud_supported(c: &CloudOpsConfig) -> bool {
    c.supported_clouds.contains(&c.default_cloud)
}

Prevention

When it happens

Trigger: `default_cloud = "aws"` with `supported_clouds = ["gcp"]`; `default_cloud = "AWS"` with `supported_clouds = ["aws"]` (case mismatch); whitespace inside a list entry (e.g. `" aws"`) so the exact match fails even though the value looks right.

Common situations: Narrowing cloud support to one provider and forgetting the default; uppercase cloud names pasted from vendor docs; templated lists where the default comes from a different variable than the list and they drift.

Related errors


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