sgl-project/sglang · error · MMError
{error_msg}
Error message
{error_msg} What it means
Terminal failure of execute_encode_pipeline: after an exception in the multimodal encode pipeline, the error is wrapped in MMError with an HTTP status code (defaulting to 500) and re-raised after recording a pipeline 'error' result and attempting an error send back to the requester. The message is whatever the underlying failure reported (error_msg), so it is a generic wrapper for any encode-pipeline exception.
Source
Thrown at python/sglang/srt/disaggregation/encoder/runtime.py:1160
if error_msg:
time_stats.trace_ctx.abort(abort_info={"reason": error_msg})
await server_module.meta_registry.publish(req_id, 0, 0, 0, error=error_msg)
if backend == "mooncake":
await enc.release_request(req_id, preserve_metadata=True)
else:
try:
await _push_embedding_to_prefill(
enc,
request,
background_url_send=True,
)
except Exception as send_err:
logger.error(
f"Error-send failed for req_id={req_id}: {send_err}",
exc_info=True,
)
_record_pipeline_result(modality, "error")
raise MMError(error_msg, code=error_code or HTTPStatus.INTERNAL_SERVER_ERROR)
time_stats.set_mm_encode_end_time()
try:
# Publish the actual result for every backend. ZMQ does not consume this
# early and removes it when its synchronous send releases the request.
await server_module.meta_registry.publish(
req_id, nbytes, embedding_len, embedding_dim
)
if backend == "mooncake":
request.pop("mm_items", None)
request.update(
embedding_size=nbytes,
embedding_len=embedding_len,
embedding_dim=embedding_dim,
)
content = request
else:View on GitHub (pinned to 0132848349)
Solutions
- Read the wrapped error_msg / logged traceback to identify the root-cause exception — MMError itself is only a carrier.
- Fix the underlying cause (e.g. missing grid keys, bad URL scheme, OOM) per its specific error.
- Ensure the encoder model/processor version matches the receiver's expectations.
- Check that error_code propagation is desired; without one it surfaces as HTTP 500.
Defensive patterns
Strategy: try-catch
Try / catch
try:
result = await runtime.execute_encode_pipeline(req)
except MMError as e:
logger.error("encode pipeline failed (%s): %s", e.code, e)
respond_error(req_id, str(e), code=e.code or 500)
return # do not crash the encoder worker loop Prevention
- Validate multimodal inputs (grid metadata, modalities, hashes) before submitting to the pipeline.
- Catch MMError at the request handler boundary so one bad request does not kill the encoder runtime.
- Monitor per-modality 'error' pipeline results as a health metric.
- Keep encoder and receiver model/processor versions in sync to avoid decode-stage failures.
When it happens
Trigger: Any exception inside the encoder pipeline stages (processor failure, encoder backend error, invalid mm input like missing grid dims, network send failure) while handling handle_encode_request / _dp_worker_handle_request; the wrapper fires per-request with the original error message and code.
Common situations: Encoder service OOM or model load failure; invalid multimodal inputs (missing/invalid grid metadata); unreachable downstream receiver; version mismatch between encoder and receiver causing decode errors.
Related errors
- Grouped pipeline returned fewer outputs than requests.
- Expected {len(reqs)} grouped outputs, got {len(output_batch.
- Unknown image_vae_encoding_position: {image_vae_encoding_pos
- gRPC encode only supports IMAGE modality, got: {non_image}
- Encoder produced {mm_embedding.shape[0]} tokens, but preproc
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/7f9cc712835b21bd.
Report an issue: GitHub.