vllm-project/vllm · error · ValueError

Request {req_id} is not in _unfinished_requests

Error message

Request {req_id} is not in _unfinished_requests

What it means

In MooncakeStoreScheduler's schedule hook, a scheduled decode/chunked-prefill request id was not found in _unfinished_requests. The code path first tracks new prefill requests; any other scheduled request must already be present, so a miss means the request finished (or was preempted/resumed) between scheduler bookkeeping and this lookup — an invariant break rather than an expected condition.

Source

Thrown at vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/scheduler.py:301

                        block_hashes=request_real.block_hashes,
                        is_last_chunk=(
                            request_tracker.token_len >= last_chunk_tokens_num
                        ),
                    )
                else:
                    # Decode/chunked request
                    request_tracker = self._request_trackers[req_id]
                    num_new_tokens = scheduler_output.num_scheduled_tokens[req_id]
                    req_tuple = self._unfinished_requests.get(req_id)
                    if req_tuple:
                        unfinished_req = req_tuple[0]
                        num_current_tokens = request_tracker.token_len
                        new_token_ids = unfinished_req.all_token_ids[
                            num_current_tokens : num_current_tokens + num_new_tokens
                        ]
                        request_tracker.token_len += len(new_token_ids)
                    else:
                        raise ValueError(
                            f"Request {req_id} is not in _unfinished_requests"
                        )
                    num_computed_token = cached_reqs.num_computed_tokens[i]
                    # Use the tracker's snapshot of the prefill range so resumed
                    # requests keep saving past the original prompt boundary.
                    prefill_end = request_tracker.prefill_end_tokens
                    if num_computed_token >= prefill_end:
                        continue
                    request_tracker.update(new_block_ids)

                    last_chunk_tokens_num = (
                        prefill_end // self._block_size * self._block_size
                    )
                    req_meta = ReqMeta.from_request_tracker(
                        request_tracker,
                        self._block_size,
                        load_spec=None,
                        skip_save=force_skip_save,

View on GitHub (pinned to c794754062)

Solutions

  1. Upgrade vLLM to the latest release — this is an internal consistency bug, not a user config error
  2. Check server logs for the same req_id being finished/aborted in the same step (preemption or abort storm) and report the sequence in a vLLM issue
  3. As a workaround, avoid request preemption while MooncakeStoreConnector is active (disable preemption mode that evicts active requests) until fixed
Defensive patterns

Strategy: try-catch

Try / catch

try:
    process_scheduler_output(scheduler_output)
except ValueError as e:
    if "not in _unfinished_requests" in str(e):
        logger.warning("store scheduler desync on abort/preempt; skipping step")
    else:
        raise

Prevention

When it happens

Trigger: A request disappears from _unfinished_requests (finished, aborted, or preempted-and-rebuilt) while scheduler_output still lists it in scheduled_tokens; or resumed/preempted requests whose ids are not re-registered in the unfinished map on the path that reaches the decode branch.

Common situations: Request abortion racing with the KV-transfer scheduler hook; chunked prefill with preemption; version regressions in the scheduler-connector interaction after upgrading vLLM.

Related errors


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