srbhr/Resume-Matcher · error · HTTPException
Resume not found
Error message
Resume not found
What it means
Raised by analyze_resume in apps/backend/app/routers/enrichment.py when db.get_resume(resume_id) returns no document for the given ID. The AI enrichment analysis cannot proceed without the stored resume, so a 404 is returned.
Source
Thrown at apps/backend/app/routers/enrichment.py:97
"item_type": "project",
"title": entry.get("name", ""),
"subtitle": entry.get("role", ""),
"current_description": desc if isinstance(desc, list) else [desc] if isinstance(desc, str) and desc else [],
}
return {}
@router.post("/analyze/{resume_id}", response_model=AnalysisResponse)
async def analyze_resume(resume_id: str) -> AnalysisResponse:
"""Analyze a resume to identify items that need enrichment.
Uses AI to examine Experience and Projects sections for weak,
vague, or incomplete descriptions and generates clarifying questions.
"""
# Fetch resume
resume = await db.get_resume(resume_id)
if not resume:
raise HTTPException(status_code=404, detail="Resume not found")
# Get processed data
processed_data = resume.get("processed_data")
if not processed_data:
raise HTTPException(
status_code=400,
detail="Resume has no processed data. Please re-upload the resume.",
)
# Build prompt with content language
resume_json = json.dumps(processed_data)
language = get_content_language()
output_language = get_language_name(language)
prompt = ANALYZE_RESUME_PROMPT.format(
resume_json=resume_json,
output_language=output_language
)
View on GitHub (pinned to 116f9cc3b0)
Solutions
- Verify the resume_id exists (list resumes or GET the resume first)
- Re-upload the resume to obtain a fresh valid ID
- Check you are pointed at the same database/environment where the resume was stored
- Fix client state so it refreshes resume IDs after deletion or DB reset
Example fix
// before
await analyzeResume('abc123') // deleted id
// after
const resumes = await listResumes();
await analyzeResume(resumes[0].id) Defensive patterns
Strategy: validation
Validate before calling
const resume = await api.getResume(resumeId);
if (!resume) throw new Error(`Resume ${resumeId} not found`); Type guard
function resumeExists(r) { return r != null && typeof r.id === 'string'; } Try / catch
try { await api.analyzeResume(id); } catch (e) { if (e.status === 404) { await refreshResumeList(); } else throw e; } Prevention
- Refresh resume IDs after delete/re-upload operations
- Persist resume IDs only per environment
- Check resume existence before enrichment calls
- Subscribe to delete events to purge stale IDs from client state
When it happens
Trigger: POSTing to the enrichment analyze endpoint with a resume_id that does not exist in the database (deleted resume, wrong ID, wrong database/environment).
Common situations: Stale resume IDs cached in frontend state after a DB reset or re-upload; using an ID from another environment (dev vs prod); resume deleted concurrently.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Job not found
- Failed to update cover letter (status ${res.status}): ${text
- Failed to update outreach message (status ${res.status}): ${
- Failed to rename resume (status ${res.status}): ${text}
- Resume has no processed data. Please re-upload the resume.
AI-assisted analysis of srbhr/Resume-Matcher@116f9cc3b0 (2026-08-28).
Data as JSON: /api/errors/e29c30200efe73b3.
Report an issue: GitHub.