vllm-project/vllm · critical

failed to parse `RUST_LOG`

Error message

failed to parse `RUST_LOG`

What it means

Startup panic in the Rust tracing setup (rust/src/tracing/src/lib.rs:65): the value of the `RUST_LOG` environment variable cannot be parsed as a tracing-subscriber `Targets` filter (e.g. `RUST_LOG=hyper=info,=debug` or `RUST_LOG=,,`). The `.expect` makes this fatal at frontend initialization, before serving.

Source

Thrown at rust/src/tracing/src/lib.rs:65

}

/// Build the CLI log filter by merging the vLLM-style default level with
/// Rust-style target overrides.
///
/// Precedence:
/// - Start from `VLLM_LOGGING_LEVEL` as the default level for all targets.
/// - If `RUST_LOG` contains a global default level such as `warn`, it overrides
///   `VLLM_LOGGING_LEVEL`.
/// - Any explicit target directives in `RUST_LOG`, such as `hyper=info`, override whichever default
///   level is active for those targets only.
fn build_targets_filter(vllm_logging_level: Option<&str>, rust_log: Option<&str>) -> Targets {
    let mut filter =
        Targets::new().with_default(map_python_log_level(vllm_logging_level.unwrap_or("INFO")));

    if let Some(rust_log) = rust_log
        && !rust_log.is_empty()
    {
        let rust_log_targets: Targets = rust_log.parse().expect("failed to parse `RUST_LOG`");
        if let Some(default_level) = rust_log_targets.default_level() {
            filter = filter.with_default(default_level);
        }
        filter = filter.with_targets(rust_log_targets);
    }

    filter
}

#[derive(Debug, Clone, Copy)]
struct VllmLocalTimer {
    local_offset: UtcOffset,
}

impl Default for VllmLocalTimer {
    fn default() -> Self {
        let local_offset = UtcOffset::current_local_offset().unwrap_or(UtcOffset::UTC);
        Self { local_offset }

View on GitHub (pinned to c794754062)

Solutions

  1. Fix or unset RUST_LOG; valid forms: 'info', 'warn', 'hyper=debug,vllm_engine_core=trace'
  2. Use VLLM_LOGGING_LEVEL for the global default instead, leaving RUST_LOG unset
  3. Print the variable before launch (`echo $RUST_LOG`) to catch quoting artifacts

Example fix

# before
RUST_LOG='hyper=info,=debug' vllm serve ...

# after
RUST_LOG='hyper=info,vllm=debug' vllm serve ...
Defensive patterns

Strategy: validation

Validate before calling

# validate before launching the frontend
python - <<'EOF'
import os
v = os.environ.get("RUST_LOG")
if v:
    for directive in v.split(','):
        d = directive.strip()
        if d and '=' in d:
            _, level = d.rsplit('=', 1)
            assert level in {"trace","debug","info","warn","error","off"}, f"bad RUST_LOG: {d}"
        elif d:
            assert d in {"trace","debug","info","warn","error","off"}, f"bad RUST_LOG: {d}"
EOF

Prevention

When it happens

Trigger: Starting the vLLM Rust frontend with a syntactically invalid RUST_LOG: empty directives, dangling `=level`, unknown level names like `RUST_LOG=verbose`, or stray commas/semicolons.

Common situations: Copy-pasted RUST_LOG from docs of a different logger; shell quoting that mangles the value; CI environments injecting a RUST_LOG intended for another crate's format; level names valid in Python logging (WARN, DEBUG ok) vs invalid ones.

Understand the failure class

Related errors


AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14). Data as JSON: /api/errors/6ce7fd57d338202f. Report an issue: GitHub.