zeroclaw-labs/zeroclaw · error

cloud_ops.supported_clouds must not be empty when cloud_ops

Error message

cloud_ops.supported_clouds must not be empty when cloud_ops is enabled

What it means

When `cloud_ops` is enabled, `supported_clouds` must contain at least one entry. The default is `["aws", "azure", "gcp"]`, so this error occurs only when the operator explicitly overrode the list with an empty array while keeping the feature on — an enabled module with zero supported clouds has no valid target, not even for `default_cloud`.

Source

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

            default_cloud: default_cloud_ops_cloud(),
            supported_clouds: default_cloud_ops_supported_clouds(),
            iac_tools: default_cloud_ops_iac_tools(),
            cost_threshold_monthly_usd: default_cloud_ops_cost_threshold(),
            well_architected_frameworks: default_cloud_ops_waf(),
        }
    }
}

impl CloudOpsConfig {
    pub fn validate(&self) -> Result<()> {
        if self.enabled {
            if self.default_cloud.trim().is_empty() {
                anyhow::bail!(
                    "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
                );

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. List the clouds you actually use, e.g. `supported_clouds = ["gcp"]`.
  2. Ensure `default_cloud` is a member of the list (checked separately).
  3. Remove the key entirely to restore the aws/azure/gcp default.

Example fix

# before
[cloud_ops]
enabled = true
supported_clouds = []

# after
[cloud_ops]
enabled = true
supported_clouds = ["gcp"]
default_cloud = "gcp"
Defensive patterns

Strategy: validation

Validate before calling

anyhow::ensure!(
    !cloud_ops.enabled || !cloud_ops.supported_clouds.is_empty(),
    "cloud_ops.supported_clouds required when enabled"
);

Prevention

When it happens

Trigger: `enabled = true` with `supported_clouds = []`; a templated list whose loop renders zero items; deleting the list contents while narrowing cloud support and leaving the empty key.

Common situations: Intent to support a single cloud expressed by emptying the list first; env-driven list generation that yields nothing when the variable is missing; refactors that move entries to a new key and leave the old one empty.

Related errors


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