vectordotdev/vector · critical
Unable to create async runtime
Error message
Unable to create async runtime
What it means
Vector's `build_runtime` constructs the tokio async runtime via a `RuntimeBuilder` (with configured worker threads and event chunk size) and panics if `rt_builder.build()` fails. Runtime construction fails on invalid thread counts or OS resource limits (e.g. cannot spawn worker threads), so Vector treats it as an unrecoverable startup error.
Solutions
- Reduce the `--threads` value to something the environment supports (or omit it for default CPU count)
- Check `ulimit -u` / container pids-limit and raise it if worker threads cannot be spawned
- Free system resources or move to a less constrained host
- Avoid catching this at the call site — it is fatal; if embedding Vector, build your own runtime and pass it in instead of `build_runtime`
Example fix
// before vector --threads 4096 --config config.yaml # panics: Unable to create async runtime // after vector --threads 4 --config config.yaml # or omit --threads
Defensive patterns
Strategy: validation
Validate before calling
let nproc = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
assert!(threads <= nproc * 4, "--threads {threads} likely exceeds environment thread limits"); Try / catch
// fatal at startup; no recovery — validate options before calling build_runtime
match rt_builder.build() {
Ok(rt) => Ok(rt),
Err(e) => Err(format!("cannot start runtime ({e}); lower --threads or raise pid limits")),
} Prevention
- Cap --threads to available CPUs; omit the flag to use defaults
- Raise container pids-limit / ulimit -u on constrained hosts
- Smoke-test startup configs with low thread counts in CI containers mirroring production limits
When it happens
Trigger: Starting Vector with `--threads N` where the OS cannot spawn N worker threads (RLIMIT_NPROC limits, huge thread counts), or a tokio builder misconfiguration.
Common situations: Running in restricted containers (low pid limits); specifying an enormous --threads value; resource-exhausted hosts.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- Failed to set up SIGINT handler.
- should not fail to build current-thread runtime
- concurrent map task cancelled outside of our control
- double thread initialization
- Failed to build HTTP server from TCP listener
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/6feab335f5cb59a8.
Report an issue: GitHub.
Appendix: 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 bdb87aeaa4)