{"record":{"id":"7f9cc712835b21bd","repo":"sgl-project/sglang","slug":"error-msg","errorCode":null,"errorMessage":"{error_msg}","messagePattern":"\\{error_msg\\}","errorType":"http","errorClass":"MMError","httpStatus":500,"severity":"error","filePath":"python/sglang/srt/disaggregation/encoder/runtime.py","lineNumber":1160,"sourceCode":"    if error_msg:\n        time_stats.trace_ctx.abort(abort_info={\"reason\": error_msg})\n        await server_module.meta_registry.publish(req_id, 0, 0, 0, error=error_msg)\n        if backend == \"mooncake\":\n            await enc.release_request(req_id, preserve_metadata=True)\n        else:\n            try:\n                await _push_embedding_to_prefill(\n                    enc,\n                    request,\n                    background_url_send=True,\n                )\n            except Exception as send_err:\n                logger.error(\n                    f\"Error-send failed for req_id={req_id}: {send_err}\",\n                    exc_info=True,\n                )\n        _record_pipeline_result(modality, \"error\")\n        raise MMError(error_msg, code=error_code or HTTPStatus.INTERNAL_SERVER_ERROR)\n\n    time_stats.set_mm_encode_end_time()\n    try:\n        # Publish the actual result for every backend. ZMQ does not consume this\n        # early and removes it when its synchronous send releases the request.\n        await server_module.meta_registry.publish(\n            req_id, nbytes, embedding_len, embedding_dim\n        )\n\n        if backend == \"mooncake\":\n            request.pop(\"mm_items\", None)\n            request.update(\n                embedding_size=nbytes,\n                embedding_len=embedding_len,\n                embedding_dim=embedding_dim,\n            )\n            content = request\n        else:","sourceCodeStart":1142,"sourceCodeEnd":1178,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/disaggregation/encoder/runtime.py#L1142-L1178","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = await runtime.execute_encode_pipeline(req)\nexcept MMError as e:\n    logger.error(\"encode pipeline failed (%s): %s\", e.code, e)\n    respond_error(req_id, str(e), code=e.code or 500)\n    return  # do not crash the encoder worker loop","preventionTips":["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."],"tags":["encoder","pipeline","error-wrapper","epd","multimodal"],"backgroundTag":"pipeline-stage-failure","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}