{"record":{"id":"0998a3b6641af9e5","repo":"vllm-project/vllm","slug":"cannot-continue-the-final-message-when-the-last-me","errorCode":null,"errorMessage":"cannot continue the final message when the last message is not from the assistant","messagePattern":"cannot continue the final message when the last message is not from the assistant","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"rust/src/chat/src/error.rs","lineNumber":14,"sourceCode":"// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: Copyright contributors to the vLLM project\n\nuse thiserror::Error;\nuse thiserror_ext::{AsReport as _, Macro};\n\ntype BoxedError = Box<dyn std::error::Error + Send + Sync>;\n\n#[derive(Debug, Error, Macro)]\n#[thiserror_ext(macro(path = \"crate::error\"))]\npub enum Error {\n    #[error(\"chat request must contain at least one message\")]\n    EmptyMessages,\n    #[error(\"cannot continue the final message when the last message is not from the assistant\")]\n    ContinueFinalAssistantWithoutFinalAssistant,\n    #[error(\"chat template is required but none was configured\")]\n    MissingChatTemplate,\n    #[error(\"chat template error: {0}\")]\n    ChatTemplate(String),\n    #[error(\"multimodal input is not supported by this chat renderer\")]\n    UnsupportedMultimodalRenderer,\n    #[error(\"unsupported multimodal content: {0}\")]\n    UnsupportedMultimodalContent(&'static str),\n    #[error(\"`{modality}` input is not supported by this model\")]\n    UnsupportedModality { modality: String },\n    #[error(\"At most {limit} {modality}(s) may be provided in one prompt.\")]\n    MmLimitExceeded { modality: String, limit: usize },\n    #[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,","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/rust/src/chat/src/error.rs#L1-L32","documentation":"The pynccl EPLB path requires a healthy PyNCCL communicator on the device group (pynccl_comm exists, is not disabled, and reports available). One of those conditions failed, so the requested backend cannot be used.","triggerScenarios":"Creating the pynccl EPLB communicator when vLLM was started with VLLM_USE_V1/or config paths that disable pynccl, when the pynccl build was unavailable at group init, or on platforms where the pynccl extension did not load.","commonSituations":"Custom builds without the pynccl extension; a distributed init path that never created device_communicator.pynccl_comm; the pynccl comm was disabled via config because another backend owns NCCL.","solutions":["Verify device group init succeeded and pynccl was not disabled (check startup logs for pynccl initialization lines)","Use backend='torch_nccl', which uses torch.distributed NCCL instead of PyNCCL","Reinstall a vLLM build that includes the pynccl extension if logs show it failed to load"],"exampleFix":"# before\nbackend = \"pynccl\"  # pynccl disabled in this process\n\n# after\nbackend = \"torch_nccl\"","handlingStrategy":"validation","validationCode":"comm = group_coordinator.device_communicator\npynccl = getattr(comm, 'pynccl_comm', None) if comm else None\nusable = pynccl is not None and not pynccl.disabled and pynccl.available\nbackend = 'pynccl' if usable else 'torch_nccl'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check pynccl availability in startup logs before configuring it","Keep torch_nccl as the fallback backend choice in deployment configs"],"tags":["eplb","pynccl","nccl","vllm"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}