{"record":{"id":"7aac3b250e234607","repo":"jamiepine/voicebox","slug":"no-rocm-backend-found-to-delete","errorCode":null,"errorMessage":"No ROCm backend found to delete","messagePattern":"No ROCm backend found to delete","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"backend/routes/rocm.py","lineNumber":57,"sourceCode":"\n    create_background_task(_download())\n    return {\"message\": \"ROCm backend download started\", \"progress_key\": rocm.PROGRESS_KEY}\n\n\n@router.delete(\"/backend/rocm\")\nasync def delete_rocm_backend():\n    \"\"\"Delete the downloaded ROCm backend binary.\"\"\"\n    from ..services import rocm\n\n    if rocm.is_rocm_active():\n        raise HTTPException(\n            status_code=409,\n            detail=\"Cannot delete ROCm backend while it is active. Switch to CPU first.\",\n        )\n\n    deleted = await rocm.delete_rocm_binary()\n    if not deleted:\n        raise HTTPException(status_code=404, detail=\"No ROCm backend found to delete\")\n\n    return {\"message\": \"ROCm backend deleted\"}\n\n\n@router.get(\"/backend/rocm-progress\")\nasync def get_rocm_download_progress():\n    \"\"\"Get ROCm backend download progress via Server-Sent Events.\"\"\"\n    progress_manager = get_progress_manager()\n\n    async def event_generator():\n        async for event in progress_manager.subscribe(\"rocm-backend\"):\n            yield event\n\n    return StreamingResponse(\n        event_generator(),\n        media_type=\"text/event-stream\",\n        headers={\n            \"Cache-Control\": \"no-cache\",","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/jamiepine/voicebox/blob/51f49dea198384b4eb6087b72c17057c6eb1c1cd/backend/routes/rocm.py#L39-L75","documentation":"Returned by DELETE /backend/rocm when rocm.delete_rocm_binary() returns a falsy result (HTTP 404). This means the active check passed but no binary file was found on disk to delete — the ROCm backend is not installed at the expected path.","triggerScenarios":"DELETE /backend/rocm when the binary was never downloaded, was already deleted, or was manually removed from the filesystem outside the app. The progress entry is inactive so the active-check passes, but the file is absent.","commonSituations":"User deleted the binary by hand. A previous successful delete left stale UI state suggesting the backend exists. Fresh install where download never completed.","solutions":["Confirm via GET /backend/status (or equivalent) whether a ROCm binary path exists before deleting.","Treat 404 as success-equivalent if the goal is 'ensure ROCm is removed'.","If the UI shows ROCm as present, refresh backend status to reconcile.","Avoid issuing DELETE when the binary is known-absent; guard with an existence check."],"exampleFix":"// before\nawait api.delete('/backend/rocm');\n\n// after\nconst present = await rocmBinaryExists();\nif (!present) return { removed: true, alreadyAbsent: true };\nawait api.delete('/backend/rocm');","handlingStrategy":"fallback","validationCode":"async function rocmBinaryPresent() {\n  const s = await (await fetch('/api/backend/rocm-status')).json();\n  return !!s.installed;\n}","typeGuard":"function isRocmInstalled(s) { return !!s && s.installed === true; }","tryCatchPattern":"try { await api.delete('/backend/rocm'); }\ncatch (e) { if (e.response?.status === 404) return { removed: true }; throw e; }","preventionTips":["Check backend status for the ROCm binary path before deleting.","Treat 404 on delete as 'already removed' success.","Reconcile UI state after manual file deletion."],"tags":["fastapi","http","not-found","rocm","backend","rest"],"backgroundTag":null,"analyzedSha":"51f49dea198384b4eb6087b72c17057c6eb1c1cd","analyzedAt":"2026-08-12T16:51:42.824Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}