openai/codex · error · std::io::Error
failed to read
Error message
failed to read {}: {error} What it means
I/O wrapper in read_bytes (otlp.rs): an fs::read of a configured OTLP TLS/certificate file failed; the underlying OS error is wrapped into "failed to read {path}: {error}" and returned as a Box<dyn Error>. Called when building gRPC TLS config and HTTP clients, so a missing/unreadable cert fails exporter setup.
Solutions
- Verify the configured certificate file path exists and is readable
- Check file permissions for the process user
- Regenerate or re-deploy the certificate if it was removed
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at codex-rs/otel/src/otlp.rs:218 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/277a533cd3c35204.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/otel/src/otlp.rs:218
if let Some(timeout) = read_timeout_env(OTEL_EXPORTER_OTLP_TIMEOUT) {
return timeout;
}
OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT
}
fn read_timeout_env(var: &str) -> Option<Duration> {
let value = env::var(var).ok()?;
let parsed = value.parse::<i64>().ok()?;
if parsed < 0 {
return None;
}
Some(Duration::from_millis(parsed as u64))
}
fn read_bytes(path: &AbsolutePathBuf) -> Result<(Vec<u8>, PathBuf), Box<dyn Error>> {
match fs::read(path) {
Ok(bytes) => Ok((bytes, path.to_path_buf())),
Err(error) => Err(Box::new(io::Error::new(
error.kind(),
format!("failed to read {}: {error}", path.display()),
))),
}
}
fn config_error(message: impl Into<String>) -> Box<dyn Error> {
Box::new(io::Error::new(ErrorKind::InvalidData, message.into()))
}
#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
use tokio::runtime::Builder;
#[test]
fn current_tokio_runtime_is_multi_thread_detects_runtime_flavor() {View on GitHub (pinned to 339751715c)