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

  1. Read the wrapped error_msg / logged traceback to identify the root-cause exception — MMError itself is only a carrier.
  2. Fix the underlying cause (e.g. missing grid keys, bad URL scheme, OOM) per its specific error.
  3. Ensure the encoder model/processor version matches the receiver's expectations.
  4. 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

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


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/7f9cc712835b21bd. Report an issue: GitHub.