openai/codex · error · std::io::Error
error loading otel config
Error message
error loading otel config: {e} What it means
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.
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/mcp-server/src/lib.rs:93 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/524b305ee05e2e28.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/mcp-server/src/lib.rs:93
})?;
let config = ConfigBuilder::default()
.cli_overrides(cli_kv_overrides)
.strict_config(strict_config)
.build()
.await
.map_err(|e| {
std::io::Error::new(ErrorKind::InvalidData, format!("error loading config: {e}"))
})?;
config.auth_config().validate()?;
set_default_client_residency_requirement(config.enforce_residency.value());
let otel = codex_core::otel_init::build_provider(
&config,
env!("CARGO_PKG_VERSION"),
Some(OTEL_SERVICE_NAME),
DEFAULT_ANALYTICS_ENABLED,
)
.map_err(|e| {
std::io::Error::new(
ErrorKind::InvalidData,
format!("error loading otel config: {e}"),
)
})?;
codex_core::otel_init::record_process_start(otel.as_ref(), OTEL_SERVICE_NAME);
codex_core::otel_init::install_sqlite_telemetry(otel.as_ref(), OTEL_SERVICE_NAME);
let state_db = codex_core::init_state_db(&config).await;
let environment_manager = Arc::new(
EnvironmentManager::from_codex_home(
config.codex_home.clone(),
Some(ExecServerRuntimePaths::from_optional_paths(
arg0_paths.codex_self_exe.clone(),
arg0_paths.codex_linux_sandbox_exe.clone(),
)?),
config.http_client_factory(),
)
.await
.map_err(std::io::Error::other)?,View on GitHub (pinned to 339751715c)