sgl-project/sglang · warning · HTTPException

Mesh has been uploaded to cloud storage. Please use the clou

Error message

Mesh has been uploaded to cloud storage. Please use the cloud URL: {job.get('url')}

What it means

The mesh artifact was uploaded to cloud storage, so local download is refused with HTTP 400 and the cloud URL is returned in the detail message. This is a redirect-by-error pattern, not a real failure.

Source

Thrown at python/sglang/multimodal_gen/runtime/entrypoints/openai/mesh_api.py:263

@router.delete("/{mesh_id}", response_model=MeshResponse)
async def delete_mesh(mesh_id: str = Path(...)):
    job = await MESH_STORE.pop(mesh_id)
    if not job:
        raise HTTPException(status_code=404, detail="Mesh not found")
    job["status"] = "deleted"
    return MeshResponse(**job)


@router.get("/{mesh_id}/content")
async def download_mesh_content(
    mesh_id: str = Path(...), variant: Optional[str] = Query(None)
):
    job = await MESH_STORE.get(mesh_id)
    if not job:
        raise HTTPException(status_code=404, detail="Mesh not found")

    if job.get("url"):
        raise HTTPException(
            status_code=400,
            detail=f"Mesh has been uploaded to cloud storage. Please use the cloud URL: {job.get('url')}",
        )

    file_path = job.get("file_path")
    if not file_path or not os.path.exists(file_path):
        raise HTTPException(status_code=404, detail="Generation is still in-progress")

    ext = os.path.splitext(file_path)[1].lower()
    media_type = {
        ".glb": "model/gltf-binary",
        ".obj": "text/plain",
    }.get(ext, "application/octet-stream")

    return FileResponse(
        path=file_path, media_type=media_type, filename=os.path.basename(file_path)
    )

View on GitHub (pinned to 0132848349)

Solutions

  1. Parse the cloud URL out of the 404/400 response detail and fetch from there
  2. Check the job record via GET /{mesh_id} for the 'url' field before calling /content
  3. Update the client to prefer job['url'] when present

Example fix

# before
content = await client.get(f"/v1/mesh/{id}/content").content
# after
job = (await client.get(f"/v1/mesh/{id}")).json()
if job.get("url"):
    content = await fetch(job["url"])
else:
    content = (await client.get(f"/v1/mesh/{id}/content")).content
Defensive patterns

Strategy: fallback

Validate before calling

job = (await client.get(f'/v1/mesh/{id}')).json()
url = job.get('url')
if url: download_from(url)  # skip /content entirely

Try / catch

if resp.status_code == 400 and 'cloud URL' in detail:
    url = detail.rsplit(': ', 1)[1]; fetch(url)

Prevention

When it happens

Trigger: Calling GET /{mesh_id}/content for a job whose record contains a 'url' field (cloud upload already happened).

Common situations: Deployment configured to sync outputs to object storage (S3/OSS); client using an old download flow after the server enabled cloud uploads.

Related errors


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