vllm-project/vllm · error · Error

failed to initialize {kind} parser `{name}`

Error message

failed to initialize {kind} parser `{name}`

What it means

Wraps a failure that occurs while constructing a named parser: the registry found the creator function, but the creator returned an error (captured as `#[source] BoxedError`). It distinguishes 'parser exists but failed to build' from error 20 ('parser not registered'). Typical creators validate companion config such as guided-decoding grammars or tokenizer requirements.

Source

Thrown at rust/src/chat/src/error.rs:46

    #[error("multimodal preprocessing error: {0}")]
    Multimodal(#[message] String),
    #[error("{kind} parsing is not available for model `{model_id}`")]
    ParserUnavailableForModel {
        kind: &'static str,
        model_id: String,
    },
    #[error("{kind} parsing is disabled by frontend configuration")]
    ParserDisabled { kind: &'static str },
    #[error(
        "{kind} parser `{name}` is not registered{}",
        available_parser_hint(.available_names)
    )]
    ParserUnavailableByName {
        kind: &'static str,
        name: String,
        available_names: Vec<String>,
    },
    #[error("failed to initialize {kind} parser `{name}`")]
    ParserInitialization {
        kind: &'static str,
        name: String,
        #[source]
        error: BoxedError,
    },
    #[error(
        "gpt_oss uses native Harmony output parsing; generic {kind} parser override `{selection}` is not supported"
    )]
    HarmonyParserOverrideUnsupported {
        kind: &'static str,
        selection: String,
    },
    #[error("harmony output parsing failed")]
    HarmonyOutputParsing {
        #[source]
        error: BoxedError,
    },

View on GitHub (pinned to c794754062)

Solutions

  1. Inspect the chained `#[source]` error in the log/Display chain — the root cause is the boxed source, not this message.
  2. Validate the input you passed to the parser constructor (schema, grammar, tokenizer) independently before enabling the parser.
  3. Reproduce with the parser's unit tests in rust/src/chat/src/parser/ to see if the parser itself is broken in your build.
  4. Fall back to a different registered parser for the same kind if the input cannot be fixed.

Example fix

// before
let parser = registry.create("guided_json", invalid_schema)?;

// after
let schema: Value = serde_json::from_str(SCHEMA)?; // validate JSON first
let parser = registry.create("guided_json", schema)?;
Defensive patterns

Strategy: try-catch

Try / catch

if let Err(vllm_chat::Error::ParserInitialization { name, error }) = result {
    tracing::error!(parser = %name, error = ?error, "parser init failed");
    // degrade: pick a fallback parser or reject the request with 4xx
}

Prevention

When it happens

Trigger: Calling `create(name, ...)` on a registered parser whose constructor rejects the arguments — e.g. an invalid JSON schema for a guided parser, a tokenizer that lacks properties the parser needs, or malformed grammar text.

Common situations: A guided_json schema that is not valid Draft-07 JSON Schema; passing a chat tokenizer where a tool parser expects special tokens that were stripped; version changes where a parser now requires additional metadata.

Related errors


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