{"record":{"id":"408d66df3cd8f992","repo":"xai-org/grok-build","slug":"profile-name-extends-base-name-but-off","errorCode":null,"errorMessage":"Profile '{name}' extends '{base_name}', but 'off'/'none' is not a valid base profile","messagePattern":"Profile '(.+?)' extends '(.+?)', but 'off'/'none' is not a valid base profile","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-sandbox/src/profiles.rs","lineNumber":484,"sourceCode":"\n            Self::Custom(name) => {\n                let profile_config = config.profiles.get(name).ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"Custom sandbox profile '{name}' not found. \\\n                         Define it in ~/.grok/sandbox.toml or .grok/sandbox.toml:\\n\\n\\\n                         [profiles.{name}]\\n\\\n                         extends = \\\"workspace\\\"\\n\\\n                         read_only = [\\\"/data\\\"]\\n\"\n                    )\n                })?;\n\n                // Start from the base profile if `extends` is set\n                let (base, mut profile) = if let Some(base_name) = &profile_config.extends {\n                    let base: ProfileName = base_name.parse().map_err(|e: String| {\n                        anyhow::anyhow!(\"Profile '{name}' extends invalid base: {e}\")\n                    })?;\n                    if matches!(base, Self::Off) {\n                        anyhow::bail!(\n                            \"Profile '{name}' extends '{base_name}', but 'off'/'none' \\\n                             is not a valid base profile\"\n                        );\n                    }\n                    if matches!(base, Self::Custom(_)) {\n                        anyhow::bail!(\n                            \"Profile '{name}' extends '{base_name}', but custom profiles \\\n                             cannot extend other custom profiles (only built-ins)\"\n                        );\n                    }\n                    let resolved = base.resolve(workspace, config)?;\n                    (base, resolved)\n                } else {\n                    (Self::Workspace, Self::Workspace.resolve(workspace, config)?)\n                };\n\n                profile.name = name.clone();\n","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-sandbox/src/profiles.rs#L466-L502","documentation":"This error is thrown during profile resolution when a custom profile declares `extends: 'off'` (or 'none', which parses to ProfileName::Off). The 'off' profile is a sentinel meaning 'sandbox disabled', so it carries no settings to inherit and cannot serve as a base. The library rejects it up front rather than producing a meaningless merged profile.","triggerScenarios":"Defining a profile in the sandbox config whose `extends` field is set to 'off' or 'none', then calling resolve / resolve_profile_with_runtime_sockets which parses the base name and matches it against ProfileName::Off.","commonSituations":"Users copy an existing profile and change its base to 'off' to try to 'start disabled and override'; YAML/JSON typo where extends was meant to be a built-in like 'minimal'; tooling generating configs that fill extends with a default value.","solutions":["Change the profile's `extends` to a built-in profile (e.g. 'minimal', 'standard') or a built-in non-off profile name","If the profile should be fully standalone, remove the `extends` field entirely so it starts from defaults","Validate config profiles before applying by calling resolve on each and checking the error message"],"exampleFix":"# before\n[profiles.my-profile]\nextends = \"off\"\n\n# after\n[profiles.my-profile]\nextends = \"minimal\"","handlingStrategy":"validation","validationCode":"fn validate_extends(cfg: &ProfileConfig) -> Result<(), String> {\n    if let Some(base) = &cfg.extends {\n        let b = base.trim().to_ascii_lowercase();\n        if b == \"off\" || b == \"none\" {\n            return Err(format!(\"profile '{}' extends '{base}', but off/none is not a valid base\", cfg.name));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match ProfileName::resolve(name, &workspace, &config) {\n    Ok(p) => apply(p),\n    Err(e) if e.to_string().contains(\"not a valid base profile\") => {\n        eprintln!(\"config error: {e}; fix the 'extends' field\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never set extends to 'off'/'none' — off is a sentinel, not a base","Lint config files for extends values against the built-in profile name list","When generating configs, omit the extends field rather than filling it with a default"],"tags":["config","profile","validation"],"backgroundTag":"invalid-profile-base","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}