{"record":{"id":"524b305ee05e2e28","repo":"openai/codex","slug":"error-loading-otel-config-e","errorCode":null,"errorMessage":"error loading otel config: {e}","messagePattern":"error loading otel config: (.+?)","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/mcp-server/src/lib.rs","lineNumber":93,"sourceCode":"    })?;\n    let config = ConfigBuilder::default()\n        .cli_overrides(cli_kv_overrides)\n        .strict_config(strict_config)\n        .build()\n        .await\n        .map_err(|e| {\n            std::io::Error::new(ErrorKind::InvalidData, format!(\"error loading config: {e}\"))\n        })?;\n    config.auth_config().validate()?;\n    set_default_client_residency_requirement(config.enforce_residency.value());\n    let otel = codex_core::otel_init::build_provider(\n        &config,\n        env!(\"CARGO_PKG_VERSION\"),\n        Some(OTEL_SERVICE_NAME),\n        DEFAULT_ANALYTICS_ENABLED,\n    )\n    .map_err(|e| {\n        std::io::Error::new(\n            ErrorKind::InvalidData,\n            format!(\"error loading otel config: {e}\"),\n        )\n    })?;\n    codex_core::otel_init::record_process_start(otel.as_ref(), OTEL_SERVICE_NAME);\n    codex_core::otel_init::install_sqlite_telemetry(otel.as_ref(), OTEL_SERVICE_NAME);\n    let state_db = codex_core::init_state_db(&config).await;\n    let environment_manager = Arc::new(\n        EnvironmentManager::from_codex_home(\n            config.codex_home.clone(),\n            Some(ExecServerRuntimePaths::from_optional_paths(\n                arg0_paths.codex_self_exe.clone(),\n                arg0_paths.codex_linux_sandbox_exe.clone(),\n            )?),\n            config.http_client_factory(),\n        )\n        .await\n        .map_err(std::io::Error::other)?,","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/mcp-server/src/lib.rs#L75-L111","documentation":"otel_init::build_provider failed while constructing the OpenTelemetry provider from config (env controls like OTEL_* and analytics settings). Telemetry initialization is fatal here; the wrapped error identifies which OTEL component was misconfigured.","triggerScenarios":"Thrown at codex-rs/mcp-server/src/lib.rs:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check OTEL_EXPORTER_OTLP_* and related env vars for valid endpoints and headers","Disable analytics/OTEL export if telemetry is not needed","Fix the invalid OTEL setting named in the wrapped error and restart"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}