{"record":{"id":"2cdbf589999f74cd","repo":"influxdata/influxdb","slug":"error-initializing-tokio-runtime-0","errorCode":null,"errorMessage":"Error initializing tokio runtime: {0}","messagePattern":"Error initializing tokio runtime: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"influxdb3/src/commands/serve.rs","lineNumber":123,"sourceCode":"pub const DEFAULT_ADMIN_TOKEN_RECOVERY_BIND_ADDR: &str = \"127.0.0.1:8182\";\n\npub const DEFAULT_TELEMETRY_ENDPOINT: &str = \"https://telemetry.v3.influxdata.com\";\n\nconst MIN_SNAPSHOTS_TO_LOAD_ON_START: u64 = 100;\n\nmod cli_params;\n#[cfg(test)]\nmod tests;\n\n#[derive(Debug, Error)]\npub enum Error {\n    #[error(\"Cannot parse object store config: {0}\")]\n    ObjectStoreParsing(#[from] influxdb3_clap_blocks::object_store::ParseError),\n\n    #[error(\"Tracing config error: {0}\")]\n    TracingConfig(#[from] trace_exporters::Error),\n\n    #[error(\"Error initializing tokio runtime: {0}\")]\n    TokioRuntime(#[source] std::io::Error),\n\n    #[error(\"Failed to bind address\")]\n    BindAddress(#[source] std::io::Error),\n\n    #[error(\"Server error: {0}\")]\n    Server(#[source] influxdb3_server::Error),\n\n    #[error(\"Token error: {0}\")]\n    TokenError(CatalogError),\n\n    #[error(\"Write buffer error: {0}\")]\n    WriteBuffer(#[from] influxdb3_write::write_buffer::Error),\n\n    #[error(\"invalid token: {0}\")]\n    InvalidToken(#[from] hex::FromHexError),\n\n    #[error(\"failed to initialize write buffer: {0:?}\")]","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3/src/commands/serve.rs#L105-L141","documentation":"A serve-command `Error` variant (`TokioRuntime`) carrying a `std::io::Error` as its source. It is raised when constructing the tokio async runtime for the server fails, which on most platforms means the runtime could not be created due to an OS-level error (e.g. resource limits blocking the reactor/worker setup).","triggerScenarios":"Calling `tokio::runtime::Runtime::new()`/Builder::build() during `influxdb3 serve` startup when the OS returns an io::Error (e.g. insufficient resources, failure creating event queues).","commonSituations":"Running under strict RLIMITs, containers with very low thread/file-descriptor limits, exotic environments where tokio cannot set up its I/O driver.","solutions":["Read the `#[source]` io::Error for the OS cause (errno) and fix that resource limit.","Raise file-descriptor/thread limits (ulimit -n, container limits).","Retry after freeing system resources or adjusting runtime worker count."],"exampleFix":"// before\n# docker run --limit nofile... (too low)\n// after\nulimit -n 65536\ninfluxdb3 serve ...","handlingStrategy":"try-catch","validationCode":"// Check headroom for runtime resources before launching\nlet fd_soft = rlimit::getrlimit(rlimit::Resource::NOFILE)?.0;\nassert!(fd_soft > 1024, \"file descriptor limit too low for tokio runtime\");","typeGuard":null,"tryCatchPattern":"match serve(config) {\n    Err(serve::Error::TokioRuntime(io)) => {\n        eprintln!(\"runtime init failed: {} (check ulimits/containers)\", io);\n        std::process::exit(1);\n    }\n    other => other?,\n}","preventionTips":["Raise nofile/thread ulimits in containers and systemd units","Avoid running under extremely restrictive sandbox profiles","Monitor OS resource pressure before server startup"],"tags":["rust","tokio","runtime","startup"],"backgroundTag":"internal-invariant-violation","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"}