Your current environment
The output of python collect_env.py
Collecting environment information...
==============================
System Info
==============================
OS : Ubuntu 24.04.3 LTS (x86_64)
GCC version : (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Clang version : Could not collect
CMake version : Could not collect
Libc version : glibc-2.39
==============================
PyTorch Info
==============================
PyTorch version : 2.11.0+cu130
Is debug build : False
CUDA used to build PyTorch : 13.0
ROCM used to build PyTorch : N/A
XPU used to build PyTorch : N/A
==============================
Python Environment
==============================
Python version : 3.12.3 (main, Mar 23 2026, 19:04:32) [GCC 13.3.0] (64-bit runtime)
Python platform : Linux-6.8.0-110-generic-x86_64-with-glibc2.39
==============================
CUDA / GPU Info
==============================
Is CUDA available : True
CUDA runtime version : Could not collect
CUDA_MODULE_LOADING set to :
GPU models and configuration : GPU 0: NVIDIA RTX PRO 6000 Blackwell Max-Q Workstation Edition
Nvidia driver version : 580.159.04
cuDNN version : Could not collect
HIP runtime version : N/A
MIOpen runtime version : N/A
Is XNNPACK available : True
==============================
CPU Info
==============================
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 52 bits physical, 57 bits virtual
Byte Order: Little Endian
CPU(s): 48
On-line CPU(s) list: 0-47
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Gold 5412U
CPU family: 6
Model: 143
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 1
Stepping: 8
CPU(s) scaling MHz: 27%
CPU max MHz: 3900.0000
CPU min MHz: 800.0000
BogoMIPS: 4200.00
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user
Virtualization: VT-x
L1d cache: 1.1 MiB (24 instances)
L1i cache: 768 KiB (24 instances)
L2 cache: 48 MiB (24 instances)
L3 cache: 45 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-47
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Mitigation; IBPB before exit to userspace
==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.8.post1
[pip3] numpy==2.3.5
[pip3] nvidia-cublas==13.1.0.3
[pip3] nvidia-cuda-cupti==13.0.85
[pip3] nvidia-cuda-nvrtc==13.0.88
[pip3] nvidia-cuda-runtime==13.0.96
[pip3] nvidia-cudnn-cu13==9.19.0.56
[pip3] nvidia-cudnn-frontend==1.18.0
[pip3] nvidia-cufft==12.0.0.61
[pip3] nvidia-cufile==1.15.1.6
[pip3] nvidia-curand==10.4.0.35
[pip3] nvidia-cusolver==12.0.4.66
[pip3] nvidia-cusparse==12.6.3.3
[pip3] nvidia-cusparselt-cu13==0.8.0
[pip3] nvidia-cutlass-dsl==4.4.2
[pip3] nvidia-cutlass-dsl-libs-base==4.4.2
[pip3] nvidia-ml-py==13.595.45
[pip3] nvidia-nccl-cu13==2.28.9
[pip3] nvidia-nvjitlink==13.0.88
[pip3] nvidia-nvshmem-cu13==3.4.5
[pip3] nvidia-nvtx==13.0.85
[pip3] pyzmq==27.1.0
[pip3] tokenspeed-triton==3.7.10.post20260505
[pip3] torch==2.11.0
[pip3] torch_c_dlpack_ext==0.1.5
[pip3] torchaudio==2.11.0
[pip3] torchvision==0.26.0
[pip3] transformers==5.8.1
[pip3] triton==3.6.0
[conda] Could not collect
==============================
vLLM Info
==============================
ROCM Version : Could not collect
vLLM Version : 0.21.0
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; XPU: Disabled
GPU Topology:
�[4mGPU0 CPU Affinity NUMA Affinity GPU NUMA ID�[0m
GPU0 X 0-47 0 N/A
Legend:
X = Self
SYS = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
PHB = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
PXB = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
PIX = Connection traversing at most a single PCIe bridge
NV# = Connection traversing a bonded set of # NVLinks
==============================
Environment Variables
==============================
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_inference
🐛 Describe the bug
A single chat request that triggers a ValueError inside safe_apply_chat_template (vllm/renderers/hf.py:682) freezes the entire HTTP /v1/* surface until the vLLM process is restarted. The Python process stays alive, GET /metrics keeps answering 200, GPU memory remains committed, but GET /v1/models, POST /v1/chat/completions, etc. all hang. We have to systemctl restart the unit to recover.
This is distinct from #41114, which discusses whether the underlying ValueError: System message must be at the beginning. should fire on certain inputs. The 400 reject path itself is fine — what is not fine is that the exception leaks the request slot and stalls the rest of the server.
Stack trace of the rejected request
File ".../vllm/entrypoints/openai/chat_completion/api_router.py", line 61, in create_chat_completion
File ".../vllm/entrypoints/openai/chat_completion/serving.py", line 237, in create_chat_completion
File ".../vllm/entrypoints/openai/engine/serving.py", line 634, in _with_kv_transfer_rejection_cleanup
File ".../vllm/entrypoints/openai/chat_completion/serving.py", line 256, in _create_chat_completion
File ".../vllm/entrypoints/serve/render/serving.py", line 250, in render_chat
File ".../vllm/entrypoints/serve/render/serving.py", line 562, in preprocess_chat
File ".../vllm/renderers/base.py", line 1019, in render_chat_async
File ".../vllm/renderers/hf.py", line 963, in render_messages_async
File ".../vllm/renderers/hf.py", line 682, in safe_apply_chat_template
raise ValueError(str(e)) from e
ValueError: System message must be at the beginning.
Note _with_kv_transfer_rejection_cleanup in the call chain — that wrapper either swallows the exception or otherwise prevents the request budget from being released on this path.
Reproduction
Easy on any 0.21.0 instance serving a model whose Jinja template enforces system-first ordering (qwen3.6 series, Qwen3.5-27B per #41114):
# 1. Send a malformed request once
curl -X POST http://<vllm>:8001/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "/models/qwen3.6-35b-a3b-fp8",
"messages": [
{"role":"user","content":"hi"},
{"role":"system","content":"you are a bot"},
{"role":"user","content":"ok"}
],
"max_tokens": 5
}'
# Returns 400 as expected.
# 2. Immediately send a valid request
curl -X POST http://<vllm>:8001/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "/models/qwen3.6-35b-a3b-fp8",
"messages": [{"role":"user","content":"hi"}],
"max_tokens": 5
}'
# Hangs until client timeout. Same for /v1/models.
# 3. Confirm /metrics still answers
curl http://<vllm>:8001/metrics | head
# 200 OK.
Once in this state:
vllm:num_requests_running == 0
vllm:num_requests_waiting == 0
nvidia_smi_utilization_gpu_ratio == 0
nvidia_smi_memory_used_bytes / nvidia_smi_memory_total_bytes ≈ 0.98 (model still loaded)
- The systemd unit must be restarted to recover.
Service command (Linux systemd) we run
ExecStart=/opt/vllm/venv-0.21/bin/python -m vllm.entrypoints.openai.api_server \
--model /models/qwen3.6-35b-a3b-fp8 \
--host <private-ip> --port 8001 \
--gpu-memory-utilization 0.95 \
--max-model-len 262144 --max-num-seqs 128 \
--enable-chunked-prefill --max-num-batched-tokens 32768 \
--enable-prefix-caching --enable-prompt-tokens-details \
--kv-cache-dtype fp8 \
--enable-auto-tool-choice --tool-call-parser qwen3_coder \
--reasoning-parser qwen3 \
--chat-template /models/qwen3.6-35b-a3b-fp8/chat_template_fixed.jinja \
--mm-encoder-attn-backend TORCH_SDPA \
--reasoning-config '{}' \
--override-generation-config '{"max_new_tokens":65536}'
Impact
A single misbehaving client can take down an entire vLLM backend until a human intervenes. On a fleet of N nodes behind a load-balancer (LiteLLM in our case), the same retry pattern can drain every replica within ~30 minutes.
We hit this on 2026-06-07: all 7 of our qwen3.6 backends went into this state within a single sliding window and the community was effectively offline for ~90 minutes. Public writeup: https://github.com/helmcode/nan-devops/blob/main/docs/postmortems/2026-06-07-community-models-outage.md
Workaround we shipped
Our LiteLLM pre-call hook rejects any chat request whose system message is at index ≥ 1 with HTTP 400 before it ever reaches vLLM. That has kept us out of the failure mode since. Implementation here: https://github.com/helmcode/nan-devops/blob/main/k8s/system/litellm-community-usage-hook-cm.yaml (search for system_message_not_first).
The point is that this workaround should not be necessary — the proxy in front of vLLM should not have to defend against vLLM hanging on its own exception.
Asks
- Confirm the leak in
_with_kv_transfer_rejection_cleanup (or wherever the request slot is being held) on the ValueError path. The 400 response itself is fine; the freeze of every subsequent request is what matters.
- Ship the fix in 0.22.x / 0.23.x — we are blocked from upgrading until either this is fixed or the renderer can be told to skip the strict system-position validation.
Related
Happy to provide more logs, traces, or to test a candidate patch — let me know what would help.
Your current environment
The output of
python collect_env.py🐛 Describe the bug
A single chat request that triggers a
ValueErrorinsidesafe_apply_chat_template(vllm/renderers/hf.py:682) freezes the entire HTTP/v1/*surface until the vLLM process is restarted. The Python process stays alive,GET /metricskeeps answering 200, GPU memory remains committed, butGET /v1/models,POST /v1/chat/completions, etc. all hang. We have tosystemctl restartthe unit to recover.This is distinct from #41114, which discusses whether the underlying
ValueError: System message must be at the beginning.should fire on certain inputs. The 400 reject path itself is fine — what is not fine is that the exception leaks the request slot and stalls the rest of the server.Stack trace of the rejected request
Note
_with_kv_transfer_rejection_cleanupin the call chain — that wrapper either swallows the exception or otherwise prevents the request budget from being released on this path.Reproduction
Easy on any 0.21.0 instance serving a model whose Jinja template enforces system-first ordering (qwen3.6 series, Qwen3.5-27B per #41114):
Once in this state:
vllm:num_requests_running == 0vllm:num_requests_waiting == 0nvidia_smi_utilization_gpu_ratio == 0nvidia_smi_memory_used_bytes / nvidia_smi_memory_total_bytes ≈ 0.98(model still loaded)Service command (Linux systemd) we run
Impact
A single misbehaving client can take down an entire vLLM backend until a human intervenes. On a fleet of N nodes behind a load-balancer (LiteLLM in our case), the same retry pattern can drain every replica within ~30 minutes.
We hit this on 2026-06-07: all 7 of our qwen3.6 backends went into this state within a single sliding window and the community was effectively offline for ~90 minutes. Public writeup: https://github.com/helmcode/nan-devops/blob/main/docs/postmortems/2026-06-07-community-models-outage.md
Workaround we shipped
Our LiteLLM pre-call hook rejects any chat request whose
systemmessage is at index ≥ 1 with HTTP 400 before it ever reaches vLLM. That has kept us out of the failure mode since. Implementation here: https://github.com/helmcode/nan-devops/blob/main/k8s/system/litellm-community-usage-hook-cm.yaml (search forsystem_message_not_first).The point is that this workaround should not be necessary — the proxy in front of vLLM should not have to defend against vLLM hanging on its own exception.
Asks
_with_kv_transfer_rejection_cleanup(or wherever the request slot is being held) on theValueErrorpath. The 400 response itself is fine; the freeze of every subsequent request is what matters.Related
ValueError. Conclusion in that thread is "sender-side bug". Independent of whether that decision stands, the deadlock is a separate, more serious bug.systemrole in messages array agentclientprotocol/claude-agent-acp#720 — same on the ACP side.Happy to provide more logs, traces, or to test a candidate patch — let me know what would help.