{"record":{"id":"3e245fc53c900754","repo":"zeroclaw-labs/zeroclaw","slug":"cloud-ops-default-cloud-must-not-be-empty-when-clo","errorCode":null,"errorMessage":"cloud_ops.default_cloud must not be empty when cloud_ops is enabled","messagePattern":"cloud_ops\\.default_cloud must not be empty when cloud_ops is enabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-config/src/schema.rs","lineNumber":18568,"sourceCode":"\nimpl Default for CloudOpsConfig {\n    fn default() -> Self {\n        Self {\n            enabled: false,\n            default_cloud: default_cloud_ops_cloud(),\n            supported_clouds: default_cloud_ops_supported_clouds(),\n            iac_tools: default_cloud_ops_iac_tools(),\n            cost_threshold_monthly_usd: default_cloud_ops_cost_threshold(),\n            well_architected_frameworks: default_cloud_ops_waf(),\n        }\n    }\n}\n\nimpl CloudOpsConfig {\n    pub fn validate(&self) -> Result<()> {\n        if self.enabled {\n            if self.default_cloud.trim().is_empty() {\n                anyhow::bail!(\n                    \"cloud_ops.default_cloud must not be empty when cloud_ops is enabled\"\n                );\n            }\n            if self.supported_clouds.is_empty() {\n                anyhow::bail!(\n                    \"cloud_ops.supported_clouds must not be empty when cloud_ops is enabled\"\n                );\n            }\n            for (i, cloud) in self.supported_clouds.iter().enumerate() {\n                if cloud.trim().is_empty() {\n                    validation_bail!(\n                        RequiredFieldEmpty,\n                        format!(\"cloud_ops.supported_clouds[{i}]\"),\n                        \"cloud_ops.supported_clouds[{i}] must not be empty\"\n                    );\n                }\n            }\n            if !self.supported_clouds.contains(&self.default_cloud) {","sourceCodeStart":18550,"sourceCodeEnd":18586,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-config/src/schema.rs#L18550-L18586","documentation":"`CloudOpsConfig` is only validated when `enabled = true`; in that state it must name a `default_cloud` that is non-empty after trimming. The field defaults to `\"aws\"`, so this error means the operator explicitly set it to an empty or whitespace-only string while enabling the feature.","triggerScenarios":"`[cloud_ops] enabled = true` with `default_cloud = \"\"` or `default_cloud = \"   \"`; a template variable that renders empty (e.g. `default_cloud = \"${CLOUD}\"` with the env var unset in TOML rendering); clearing the field while testing and leaving `enabled` on.","commonSituations":"Templated/Kustomize-style configs where the cloud value comes from a variable; partial edits that disable a cloud migration midway; assuming the `aws` default survives an explicit empty override (it does not — explicit empty wins).","solutions":["Set a concrete value present in your cloud tooling, e.g. `default_cloud = \"aws\"`.","Remove the `default_cloud` key entirely to fall back to the built-in `aws` default.","If using templating, assert the variable is non-empty at render time."],"exampleFix":"# before\n[cloud_ops]\nenabled = true\ndefault_cloud = \"\"\n\n# after\n[cloud_ops]\nenabled = true\ndefault_cloud = \"aws\"","handlingStrategy":"validation","validationCode":"anyhow::ensure!(\n    !cloud_ops.enabled || !cloud_ops.default_cloud.trim().is_empty(),\n    \"cloud_ops.default_cloud required when enabled\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit default_cloud to inherit the aws default instead of setting it empty.","Assert templated variables render non-empty before config generation.","Treat an explicit empty string as an override, not as 'use default'."],"tags":["cloud-ops","config","required-field","zeroclaw"],"backgroundTag":"missing-required-config-field","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}