{"record":{"id":"80e56e1486925540","repo":"vllm-project/vllm","slug":"failed-to-initialize-kind-parser-name","errorCode":null,"errorMessage":"failed to initialize {kind} parser `{name}`","messagePattern":"failed to initialize (.+?) parser `(.+?)`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"rust/src/chat/src/error.rs","lineNumber":46,"sourceCode":"    #[error(\"multimodal preprocessing error: {0}\")]\n    Multimodal(#[message] String),\n    #[error(\"{kind} parsing is not available for model `{model_id}`\")]\n    ParserUnavailableForModel {\n        kind: &'static str,\n        model_id: String,\n    },\n    #[error(\"{kind} parsing is disabled by frontend configuration\")]\n    ParserDisabled { kind: &'static str },\n    #[error(\n        \"{kind} parser `{name}` is not registered{}\",\n        available_parser_hint(.available_names)\n    )]\n    ParserUnavailableByName {\n        kind: &'static str,\n        name: String,\n        available_names: Vec<String>,\n    },\n    #[error(\"failed to initialize {kind} parser `{name}`\")]\n    ParserInitialization {\n        kind: &'static str,\n        name: String,\n        #[source]\n        error: BoxedError,\n    },\n    #[error(\n        \"gpt_oss uses native Harmony output parsing; generic {kind} parser override `{selection}` is not supported\"\n    )]\n    HarmonyParserOverrideUnsupported {\n        kind: &'static str,\n        selection: String,\n    },\n    #[error(\"harmony output parsing failed\")]\n    HarmonyOutputParsing {\n        #[source]\n        error: BoxedError,\n    },","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/rust/src/chat/src/error.rs#L28-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the chained `#[source]` error in the log/Display chain — the root cause is the boxed source, not this message.","Validate the input you passed to the parser constructor (schema, grammar, tokenizer) independently before enabling the parser.","Reproduce with the parser's unit tests in rust/src/chat/src/parser/ to see if the parser itself is broken in your build.","Fall back to a different registered parser for the same kind if the input cannot be fixed."],"exampleFix":"// before\nlet parser = registry.create(\"guided_json\", invalid_schema)?;\n\n// after\nlet schema: Value = serde_json::from_str(SCHEMA)?; // validate JSON first\nlet parser = registry.create(\"guided_json\", schema)?;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(vllm_chat::Error::ParserInitialization { name, error }) = result {\n    tracing::error!(parser = %name, error = ?error, \"parser init failed\");\n    // degrade: pick a fallback parser or reject the request with 4xx\n}","preventionTips":["Validate schemas/grammars with the same library the parser uses before passing them in.","Wrap parser construction in a startup health check so failures surface at boot, not mid-request.","Always log the chained source error, not just the wrapper message."],"tags":["rust","parser","initialization","wrapped-error"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}