jamiepine/voicebox · warning · HTTPException

No CUDA backend found to delete

Error message

No CUDA backend found to delete

What it means

HTTP 404 raised by DELETE /backend/cuda when cuda.delete_cuda_binary() returns False. The service returns False when the CUDA directory does not exist or is empty (no files to remove). The endpoint interprets that as 'nothing to delete'.

Source

Thrown at backend/routes/cuda.py:64

    create_background_task(_download())
    return {"message": "CUDA backend download started", "progress_key": "cuda-backend"}


@router.delete("/backend/cuda")
async def delete_cuda_backend():
    """Delete the downloaded CUDA backend binary."""
    from ..services import cuda

    if cuda.is_cuda_active():
        raise HTTPException(
            status_code=409,
            detail="Cannot delete CUDA backend while it is active. Switch to CPU first.",
        )

    deleted = await cuda.delete_cuda_binary()
    if not deleted:
        raise HTTPException(status_code=404, detail="No CUDA backend found to delete")

    return {"message": "CUDA backend deleted"}


@router.get("/backend/cuda-progress")
async def get_cuda_download_progress():
    """Get CUDA backend download progress via Server-Sent Events."""
    progress_manager = get_progress_manager()

    async def event_generator():
        async for event in progress_manager.subscribe("cuda-backend"):
            yield event

    return StreamingResponse(
        event_generator(),
        media_type="text/event-stream",
        headers={
            "Cache-Control": "no-cache",

View on GitHub (pinned to 51f49dea19)

Solutions

  1. Treat a 404 here as success (the backend is already absent).
  2. Check GET /backend/cuda status.available before offering delete.
  3. Make the client delete idempotent: ignore 404.

Example fix

// before
const r = await fetch('/backend/cuda', { method: 'DELETE' });
if (!r.ok) throw new Error('delete failed');
// after
const r = await fetch('/backend/cuda', { method: 'DELETE' });
if (r.status === 404) { /* nothing to delete */ }
else if (!r.ok) throw new Error('delete failed');
Defensive patterns

Strategy: try-catch

Validate before calling

const status = await fetch('/backend/cuda').then(r => r.json());
if (!status.available) throw new Error('nothing to delete');

Try / catch

const r = await fetch('/backend/cuda', { method:'DELETE' });
if (r.status === 404) { /* already absent — success */ }

Prevention

When it happens

Trigger: Calling DELETE /backend/cuda when no CUDA backend was ever downloaded, or after it was already deleted.

Common situations: User clicks delete twice; cleanup script runs against a fresh install; a prior delete already removed the directory.

Related errors


AI-assisted analysis of jamiepine/voicebox@51f49dea19 (2026-08-12). Data as JSON: /api/errors/134dcfa8ec35c839. Report an issue: GitHub.