{"record":{"id":"09ebdb1cfcca0d54","repo":"openai/codex","slug":"profile-active-user-profile-cannot-be-used-w","errorCode":null,"errorMessage":"--profile `{active_user_profile}` cannot be used while {} contains legacy `profile = \"{active_user_profile}\"` or `[profiles.{active_user_profile}]` config; move those settings into {} and remove the legacy profile selector/table. See https://developers.openai.com/codex/config-advanced#profiles for more information.","messagePattern":"--profile `(.+?)` cannot be used while (.+?) contains legacy `profile = \"(.+?)\"` or `\\[profiles\\.(.+?)\\]` config; move those settings into (.+?) and remove the legacy profile selector/table\\. See https://developers\\.openai\\.com/codex/config-advanced#profiles for more information\\.","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/config/src/loader/mod.rs","lineNumber":335,"sourceCode":"        &base_user_file,\n        /*profile*/ None,\n        ignore_user_config,\n        strict_config,\n    )\n    .await?;\n    if let Some(active_user_profile) = active_user_profile.as_ref()\n        && let Some(base_user_config) = base_user_layer.config.as_table()\n    {\n        let legacy_profile_is_selected = base_user_config\n            .get(\"profile\")\n            .and_then(TomlValue::as_str)\n            .is_some_and(|profile| profile == active_user_profile.as_str());\n        let legacy_profile_table_exists = base_user_config\n            .get(\"profiles\")\n            .and_then(TomlValue::as_table)\n            .is_some_and(|profiles| profiles.contains_key(active_user_profile.as_str()));\n        if legacy_profile_is_selected || legacy_profile_table_exists {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                format!(\n                    \"--profile `{active_user_profile}` cannot be used while {} contains legacy `profile = \\\"{active_user_profile}\\\"` or `[profiles.{active_user_profile}]` config; move those settings into {} and remove the legacy profile selector/table. See https://developers.openai.com/codex/config-advanced#profiles for more information.\",\n                    base_user_file.as_path().display(),\n                    active_user_file.as_path().display()\n                ),\n            ));\n        }\n    }\n    layers.push(base_user_layer);\n\n    if active_user_file != base_user_file {\n        layers.push(\n            load_user_config_layer(\n                fs,\n                &active_user_file,\n                active_user_profile.as_ref(),\n                ignore_user_config,","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/config/src/loader/mod.rs#L317-L353","documentation":"Error \"--profile `{active_user_profile}` cannot be used while {} contains legacy `profile = \"{active_user_profile}\"` or `[profiles.{active_user_profile}]` config; move those settings into {} and remove the legacy profile selector/table. See https://developers.openai.com/codex/config-advanced#profiles for more information.\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/config/src/loader/mod.rs:335 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the legacy profile settings into the new profile config file and remove the legacy `profile` selector or `[profiles.*]` table, as the message describes."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}