{"record":{"id":"7fef0ff61a5500ab","repo":"influxdata/influxdb","slug":"io-error-0-lib","errorCode":null,"errorMessage":"io error: {0}","messagePattern":"io error: (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/lib.rs","lineNumber":81,"sourceCode":"    #[error(\"hyper error: {0}\")]\n    Hyper(#[from] hyper::Error),\n\n    #[error(\"http error: {0}\")]\n    Http(#[from] Box<http::Error>),\n\n    #[error(\"database not found {db_name}\")]\n    DatabaseNotFound { db_name: String },\n\n    #[error(\"datafusion error: {0}\")]\n    DataFusion(#[from] datafusion::error::DataFusionError),\n\n    #[error(\"influxdb3_write error: {0}\")]\n    InfluxDB3Write(#[from] influxdb3_write::Error),\n\n    #[error(\"from hex error: {0}\")]\n    FromHex(#[from] hex::FromHexError),\n\n    #[error(\"io error: {0}\")]\n    Io(#[from] std::io::Error),\n\n    #[error(\"tls config error: {0}\")]\n    TlsConfig(String),\n\n    #[error(\"rustls error: {0}\")]\n    Rustls(#[from] rustls::Error),\n}\n\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\n#[derive(Debug, Clone)]\npub struct CommonServerState {\n    catalog: Arc<Catalog>,\n    metrics: Arc<metric::Registry>,\n    trace_exporter: Option<Arc<trace_exporters::export::AsyncExporter>>,\n    trace_header_parser: TraceHeaderParser,\n    telemetry_store: Arc<TelemetryStore>,","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/lib.rs#L63-L99","documentation":"This variant wraps std::io::Error raised anywhere in the server's request or lifecycle handling, converted automatically with #[from]. It covers filesystem I/O (loading certificates, reading config files, WAL interactions surfaced at the server layer) and network socket I/O (accepting TCP connections,读写 during request serving). The underlying OS error message follows 'io error: '.","triggerScenarios":"TCP listener accept failure while serving HTTP/gRPC; TLS certificate/key file read failures during server startup; socket errors while reading or writing an HTTP connection; any filesystem operation in the server path returning Err(io::Error).","commonSituations":"Providing a wrong path for --tls-cert/--tls-key so the cert file cannot be read; running out of file descriptors under load; port permission issues; client disconnecting mid-request producing a reset; disk full during WAL append.","solutions":["Read the inner OS error to distinguish file-system vs socket causes","Verify TLS cert/key file paths exist and are readable by the server process","Check file descriptor limits (ulimit -n) and raise them if connections fail under load","Confirm the bind address/port is correct and the process has permission to bind it","Check disk space and mount health for WAL/data directories"],"exampleFix":"// before: unreadable cert path\n--tls-cert /etc/ssl/missing.crt\n// after: verify file exists and is readable before start\nls -l /etc/ssl/influxdb.crt && influxdb3 serve --tls-cert /etc/ssl/influxdb.crt","handlingStrategy":"try-catch","validationCode":"fn check_tls_paths(cert: &str, key: &str) -> std::io::Result<()> {\n    std::fs::File::open(cert)?;\n    std::fs::File::open(key)?;\n    Ok(())\n}","typeGuard":"fn is_io_error(e: &influxdb3_server::Error) -> Option<&std::io::Error> {\n    match e { influxdb3_server::Error::Io(io) => Some(io), _ => None }\n}","tryCatchPattern":"match server_result {\n    Err(influxdb3_server::Error::Io(io)) => match io.kind() {\n        std::io::ErrorKind::NotFound => eprintln!(\"file missing: {io}\"),\n        std::io::ErrorKind::PermissionDenied => eprintln!(\"permissions: {io}\"),\n        _ => eprintln!(\"io: {io}\"),\n    },\n    Err(e) => eprintln!(\"server error: {e}\"),\n    Ok(v) => handle(v),\n}","preventionTips":["Verify cert/key and config file paths exist before starting the server","Raise file descriptor limits for production workloads","Check disk space and mount health for WAL/data directories","Distinguish transient socket errors (client disconnects) from fatal ones before retrying"],"tags":["influxdb3","io","filesystem","network"],"backgroundTag":"file-read-failed","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}