{"record":{"id":"e8a19c39f01abe50","repo":"sgl-project/sglang","slug":"unsupported-content-type-header-content-type","errorCode":null,"errorMessage":"Unsupported content type ${header.content_type}","messagePattern":"Unsupported content type (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/apps/realtime_webui/app.js","lineNumber":1108,"sourceCode":"  return restored;\n}\n\nasync function framePayloadToImageData(header, payload) {\n  let rawPayload;\n  const isRgba = header.content_type === RAW_RGBA_DELTA_GZIP_CONTENT_TYPE;\n  if (\n    header.content_type === WEBP_FRAME_CONTENT_TYPE ||\n    header.content_type === JPEG_FRAME_CONTENT_TYPE\n  ) {\n    return encodedImageToImageData(header, payload);\n  } else if (header.content_type === RAW_RGB_CONTENT_TYPE) {\n    rawPayload = payload instanceof Uint8Array ? payload : new Uint8Array(payload);\n  } else if (header.content_type === RAW_RGB_DELTA_GZIP_CONTENT_TYPE) {\n    rawPayload = await restoreDeltaGzipRawRgb(header, payload);\n  } else if (isRgba) {\n    rawPayload = await restoreDeltaGzipRawRgb(header, payload);\n  } else {\n    throw new Error(`Unsupported content type ${header.content_type}`);\n  }\n  const frameBytes = Number(header.bytes_per_frame);\n  const frameCount = Number(header.num_frames);\n  if (frameCount > 0) {\n    const offset = (frameCount - 1) * frameBytes;\n    lastRawRgbFrame = rawPayload.slice(offset, offset + frameBytes);\n  }\n  if (isRgba) {\n    return rgbaToImageData(header, rawPayload);\n  }\n  return rgbToImageData(header, rawPayload);\n}\n\nfunction isEncodedPreviewContentType(contentType) {\n  return (\n    contentType === WEBP_FRAME_CONTENT_TYPE ||\n    contentType === JPEG_FRAME_CONTENT_TYPE\n  );","sourceCodeStart":1090,"sourceCodeEnd":1126,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/apps/realtime_webui/app.js#L1090-L1126","documentation":"The mesh_processor diffusion op meshVerticeInpaint only supports method == \"smooth\"; any other string for the `method` argument raises std::invalid_argument. The dispatch is a simple if/else with a single implemented backend.","triggerScenarios":"Calling meshVerticeInpaint(texture, mask, vtx_pos, vtx_uv, pos_idx, uv_idx, method) with method set to anything other than 'smooth' — e.g. 'poisson', 'telea', 'inpaint', or a typo like 'Smooth'.","commonSituations":"Porting code from OpenCV's inpaint (which accepts INPAINT_TELEA/NS) and assuming similar method names, case mismatches, or passing a default from another library's API.","solutions":["Pass method=\"smooth\" (exact lowercase) or omit it — it's the default argument","Remove method-selection logic until additional backends are implemented in mesh_processor.cpp","Check the extension source (or its pybind docstring) for newly added methods in newer builds"],"exampleFix":"# before\nout = mesh_processor.meshVerticeInpaint(tex, mask, pos, uv, pi, ui, method=\"telea\")\n\n# after\nout = mesh_processor.meshVerticeInpaint(tex, mask, pos, uv, pi, ui, method=\"smooth\")","handlingStrategy":"validation","validationCode":"ALLOWED = {\"smooth\"}\nmethod = method if method in ALLOWED else \"smooth\"  # or raise early\nmesh_processor.meshVerticeInpaint(tex, mask, pos, uv, pi, ui, method=method)","typeGuard":"def is_supported_method(m: str) -> bool:\n    return m == \"smooth\"","tryCatchPattern":"try:\n    mesh_processor.meshVerticeInpaint(..., method=method)\nexcept ValueError as e:\n    if \"Invalid method\" in str(e):\n        method = \"smooth\"\n        mesh_processor.meshVerticeInpaint(..., method=method)\n    else:\n        raise","preventionTips":["Check the pybind docstring for supported method values before adding options","Normalize user input to lowercase and validate against an allowlist","Don't assume OpenCV inpaint method names transfer to this op"],"tags":["diffusion","mesh-inpainting","invalid-argument","cpp-extension"],"backgroundTag":"unsupported-argument-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}