{"record":{"id":"bc6ba0cbef3a590f","repo":"openai/codex","slug":"message","errorCode":null,"errorMessage":"{message}","messagePattern":"\\{message\\}","errorType":"exception","errorClass":"ConfigManagerError","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server/src/config_manager_service.rs","lineNumber":46,"sourceCode":"use codex_core::config::validate_feature_requirements_for_config_toml;\nuse codex_core::path_utils;\nuse codex_core::path_utils::SymlinkWritePaths;\nuse codex_core::path_utils::resolve_symlink_write_paths;\nuse codex_core::path_utils::write_atomically;\nuse codex_protocol::protocol::AskForApproval;\nuse codex_utils_absolute_path::AbsolutePathBuf;\nuse serde_json::Value as JsonValue;\nuse std::borrow::Cow;\nuse std::path::Path;\nuse std::path::PathBuf;\nuse thiserror::Error;\nuse tokio::task;\nuse toml::Value as TomlValue;\nuse toml_edit::Item as TomlItem;\n\n#[derive(Debug, Error)]\npub(crate) enum ConfigManagerError {\n    #[error(\"{message}\")]\n    Write {\n        code: ConfigWriteErrorCode,\n        message: String,\n    },\n\n    #[error(\"{context}: {source}\")]\n    Io {\n        context: &'static str,\n        #[source]\n        source: std::io::Error,\n    },\n\n    #[error(\"{context}: {source}\")]\n    Json {\n        context: &'static str,\n        #[source]\n        source: serde_json::Error,\n    },","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server/src/config_manager_service.rs#L28-L64","documentation":"After config loads, run_main builds the OpenTelemetry provider via otel_init::build_provider; failures — malformed OTEL_* environment variables such as an invalid OTEL_EXPORTER_OTLP_ENDPOINT, badly formatted OTEL_EXPORTER_OTLP_HEADERS, or telemetry config keys with wrong types — are wrapped as ErrorKind::InvalidData (codex-rs/mcp-server/src/lib.rs:93). Telemetry setup is treated as load-bearing, so one bad otel setting aborts startup.","triggerScenarios":"Starting codex mcp-server with a malformed OTEL_EXPORTER_OTLP_ENDPOINT (not a valid URL), OTEL_EXPORTER_OTLP_HEADERS that are not key=value pairs, or analytics/otel config keys carrying wrong value types.","commonSituations":"Copying OTEL env vars between runtimes with different formats; trailing spaces or quotes in endpoint URLs; version drift where otel config key names or semantics changed.","solutions":["Read the embedded {e} cause and fix the named env var or config key.","Unset the OTEL_* variables (or clear the otel config block) and retry to confirm they are the source.","Validate endpoint URLs and header pair formats against the OTLP env spec.","Check analytics-enabled defaults if config sets telemetry keys."],"exampleFix":"# before\nexport OTEL_EXPORTER_OTLP_ENDPOINT=\"http::/localhost:4317\"\n# after\nexport OTEL_EXPORTER_OTLP_ENDPOINT=\"http://localhost:4317\"","handlingStrategy":"try-catch","validationCode":"fn otel_env_sane() -> Result<(), String> {\n    if let Ok(ep) = std::env::var(\"OTEL_EXPORTER_OTLP_ENDPOINT\") {\n        url::Url::parse(&ep).map_err(|e| format!(\"bad OTEL endpoint: {e}\"))?;\n    }\n    if let Ok(h) = std::env::var(\"OTEL_EXPORTER_OTLP_HEADERS\") {\n        for pair in h.split(',') {\n            pair.split_once('=').ok_or_else(|| format!(\"bad header pair {pair}\"))?;\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match run_main(args, overrides, strict).await {\n    Err(e) if e.kind() == std::io::ErrorKind::InvalidData\n        && e.to_string().contains(\"otel config\") =>\n    {\n        // print OTEL_* env hints and the embedded cause, then exit nonzero\n    }\n    other => other,\n}","preventionTips":["Centralize OTEL_* env vars in one launch script and lint them before start.","Test telemetry config in staging before deploying the mcp-server.","Keep otel-related config keys out of hand-edited sections."],"tags":["telemetry","otel","opentelemetry","env-vars","startup","rust"],"backgroundTag":"otel-init-failure","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}