vectordotdev/vector · critical

Unable to create async runtime

Error message

Unable to create async runtime

What it means

app::build_runtime (src/app.rs) configures a multi-threaded tokio runtime (max_blocking_threads(20_000), enable_all, worker_threads = threads) and calls rt_builder.build().expect("Unable to create async runtime"). tokio's Builder::build panics when runtime resources cannot be created — most commonly failure to register the IO/time drivers (epoll/timerfd creation hitting the file-descriptor limit), or OS thread/resource exhaustion — which this expect re-raises at Vector startup.

Source

Thrown at src/app.rs:606

        return Err(exitcode::CONFIG);
    };
    let Some(ready_array_capacity) =
        chunk_size_events.checked_mul(crate::topology::builder::READY_ARRAY_CAPACITY_CHUNKS)
    else {
        error!("The `chunk_size_events` argument is too large.");
        return Err(exitcode::CONFIG);
    };

    vector_lib::source_sender::set_chunk_size_events(chunk_size_events);
    crate::topology::builder::set_source_sender_buffer_size(source_sender_buffer_size);
    crate::topology::builder::set_ready_array_capacity(ready_array_capacity);

    debug!(
        message = "Building runtime.",
        worker_threads = threads,
        chunk_size_events
    );
    Ok(rt_builder.build().expect("Unable to create async runtime"))
}

pub async fn load_configs(
    config_paths: &[ConfigPath],
    watcher_conf: Option<config::watcher::WatcherConfig>,
    require_healthy: Option<bool>,
    allow_empty_config: bool,
    graceful_shutdown_duration: Option<Duration>,
    signal_handler: &mut SignalHandler,
) -> Result<Config, ExitCode> {
    let config_paths = config::process_paths(config_paths).ok_or(exitcode::CONFIG)?;

    let watched_paths = config_paths
        .iter()
        .map(<&PathBuf>::from)
        .collect::<Vec<_>>();

    info!(

View on GitHub (pinned to 3708c39b12)

Solutions

  1. Raise the FD limit before starting Vector: ulimit -n 65535 (or LimitNOFILE=65535 in the systemd unit, or a container runtime default), then retry
  2. Check thread/pid headroom: cat /proc/sys/kernel/pids_max, the cgroup pids.max, and container memory limits; relax if Vector cannot spawn worker threads
  3. If running under a restrictive sandbox, allow epoll_create1, eventfd and timerfd_create syscalls
  4. Verify with a minimal run: RUST_BACKTRACE=1 vector --config minimal.yaml to capture which driver failed, and check dmesg/audit for blocked syscalls

Example fix

# before (systemd unit)
[Service]
ExecStart=/usr/bin/vector --config /etc/vector/vector.yaml

# after
[Service]
LimitNOFILE=65535
ExecStart=/usr/bin/vector --config /etc/vector/vector.yaml
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight check before build_runtime: ensure FD headroom for the IO/time drivers
let fd_limit = std::fs::read_to_string("/proc/self/limits").ok().and_then(|s| {
    s.lines().find(|l| l.starts_with("Max open files")).and_then(|l| {
        l.split_whitespace().nth(3).and_then(|v| v.parse::<usize>().ok())
    })
});
assert!(fd_limit.unwrap_or(0) > 1024, "raise ulimit -n before starting Vector");

Try / catch

// Wrap startup so a runtime-build panic degrades to a clear exit, not a crash dump
let rt = std::panic::catch_unwind(|| app::build_runtime(threads, chunk, "vector"))
    .map_err(|_| "async runtime creation failed: check ulimit -n / cgroup pids limits")?;

Prevention

When it happens

Trigger: Starting Vector in an environment where the async runtime cannot be constructed: process file-descriptor limit (ulimit -n) too low to create the epoll/timer FDs for the IO and time drivers; cgroup/container pids.max or memory limits preventing thread creation; a sandbox/seccomp profile blocking epoll_create1/timerfd_create. Threads == 0 is caught earlier with a CONFIG exit, so this panic is environmental rather than a bad --threads flag.

Common situations: Containers/systemd units with low LimitNOFILE (e.g. 1024) plus many sources/sinks; Kubernetes pods with tight pids limits; gVisor/seccomp-restricted sandboxes; heavily loaded hosts during process start.

Related errors


AI-assisted analysis of vectordotdev/vector@3708c39b12 (2026-08-20). Data as JSON: /api/errors/6feab335f5cb59a8. Report an issue: GitHub.