lfnovo/open-notebook · error · HTTPException
Error deleting transformation: {str(e)}
Error message
Error deleting transformation: {str(e)} What it means
Generic 500 from DELETE /transformations/{transformation_id} when transformation.delete() raises an unexpected exception. The record was found, so the failure is in the delete operation itself — typically SurrealDB connectivity or referential data problems.
Source
Thrown at api/routers/transformations.py:271
@router.delete("/transformations/{transformation_id}")
async def delete_transformation(transformation_id: str):
"""Delete a transformation."""
try:
transformation = await Transformation.get(transformation_id)
if not transformation:
raise HTTPException(status_code=404, detail="Transformation not found")
await transformation.delete()
return {"message": "Transformation deleted successfully"}
except HTTPException:
raise
except OpenNotebookError:
raise
except Exception as e:
logger.error(f"Error deleting transformation {transformation_id}: {str(e)}")
raise HTTPException(
status_code=500, detail=f"Error deleting transformation: {str(e)}"
)
View on GitHub (pinned to a7de90d38a)
Solutions
- Check API logs for the underlying exception message
- Verify database connectivity, then retry the DELETE
- If it keeps failing, inspect the transformation and related records directly in SurrealDB
Defensive patterns
Strategy: retry
Try / catch
resp = await client.delete(f'/transformations/{tid}')
if resp.status_code >= 500:
await asyncio.sleep(2)
resp = await client.delete(f'/transformations/{tid}') # 404 on retry means it was deleted Prevention
- Ensure database stability before delete operations
- On retry, interpret a subsequent 404 as success
- Log the 500 detail for root-cause analysis
When it happens
Trigger: DELETE while SurrealDB drops the connection, or when deleting cascades into related records and one of those operations fails.
Common situations: Database restart mid-request, network blips between API and SurrealDB, or partial corruption in related records.
Related errors
- Error fetching transformation: {str(e)}
- Error updating transformation: {str(e)}
- Error deleting session: {str(e)}
- Error executing transformation: {str(e)}
- Error fetching default prompt: {str(e)}
AI-assisted analysis of lfnovo/open-notebook@a7de90d38a (2026-08-27).
Data as JSON: /api/errors/ce14549ace184ac7.
Report an issue: GitHub.