srbhr/Resume-Matcher · error · HTTPException
Failed to delete application. Please try again.
Error message
Failed to delete application. Please try again.
What it means
This 500 HTTPException is raised by the delete_application route when the underlying db.delete_application() call throws any exception. It is a generic wrapper that hides the database error from the client while logging the real cause server-side. It means the delete operation failed at the persistence layer, not that the application was missing (that is the 404 path).
Source
Thrown at apps/backend/app/routers/applications.py:159
updates["status"] = request.status.value
try:
updated = await db.update_application(application_id, updates)
except Exception as e:
logger.error("Failed to update application %s: %s", application_id, e)
raise HTTPException(status_code=500, detail="Failed to update application. Please try again.")
if updated is None:
raise HTTPException(status_code=404, detail="Application not found")
return ApplicationResponse(**updated)
@router.delete("/{application_id}", response_model=ApplicationActionResponse)
async def delete_application(application_id: str) -> ApplicationActionResponse:
"""Delete a card."""
try:
deleted = await db.delete_application(application_id)
except Exception as e:
logger.error("Failed to delete application %s: %s", application_id, e)
raise HTTPException(status_code=500, detail="Failed to delete application. Please try again.")
if not deleted:
raise HTTPException(status_code=404, detail="Application not found")
return ApplicationActionResponse(message="Application deleted", affected=1)
@router.post("/bulk-delete", response_model=ApplicationActionResponse)
async def bulk_delete_applications(request: BulkDelete) -> ApplicationActionResponse:
"""Delete many cards."""
try:
deleted = await db.bulk_delete_applications(request.application_ids)
except Exception as e:
logger.error("Failed to bulk-delete applications: %s", e)
raise HTTPException(status_code=500, detail="Failed to delete applications. Please try again.")
return ApplicationActionResponse(message=f"Deleted {deleted} application(s)", affected=deleted)
async def _extract_company_role(job_description: str) -> dict[str, str | None]:
"""Best-effort company/role extraction for the manual-add path.View on GitHub (pinned to 116f9cc3b0)
Solutions
- Check backend logs for the 'Failed to delete application %s' line to see the underlying exception
- Verify the database (MongoDB) is reachable and credentials are valid
- Retry the delete; transient DB issues resolve after reconnection
- Fix the root-cause exception in the db layer's delete_application once identified
Example fix
// before
deleted = await db.delete_application(application_id)
// after
try:
deleted = await db.delete_application(application_id)
except Exception as e:
logger.error("Failed to delete application %s: %s", application_id, e)
raise HTTPException(status_code=500, detail="Failed to delete application. Please try again.") Defensive patterns
Strategy: try-catch
Validate before calling
const exists = await api.getApplication(id).then(() => true).catch(() => false)
if (!exists) console.warn(`application ${id} missing; skipping delete`) Try / catch
try {
await api.deleteApplication(id)
} catch (e) {
if (e.response?.status === 404) return // already gone
if (e.response?.status === 500) {
logger.error('delete failed server-side', e)
showToast('Delete failed, please retry')
}
} Prevention
- Check backend logs immediately after a 500 to find the real DB error
- Monitor database connectivity/health from the backend
- Treat 404 as success in idempotent delete flows
- Retry transient failures with backoff
When it happens
Trigger: DELETE /applications/{id} where db.delete_application raises: MongoDB connection failure/timeout, collection unavailable, serialization error in the motor/pymongo driver, or any other unhandled exception inside the db layer.
Common situations: Database is down or restarting, connection pool exhausted, network partition between backend and DB, DB credentials rotated, or a bug in db.delete_application raising on unexpected document shape.
Related errors
- Failed to delete applications. Please try again.
- Failed to update resume
- ${data.detail || Failed to delete API key (status ${res.stat
- ${data.detail || Failed to reset database (status ${res.stat
- Failed to delete resume (status ${res.status}): ${text}
AI-assisted analysis of srbhr/Resume-Matcher@116f9cc3b0 (2026-08-28).
Data as JSON: /api/errors/cfff289ac6c02c68.
Report an issue: GitHub.