{"record":{"id":"e29c30200efe73b3","repo":"srbhr/Resume-Matcher","slug":"resume-not-found","errorCode":null,"errorMessage":"Resume not found","messagePattern":"Resume not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"apps/backend/app/routers/enrichment.py","lineNumber":97,"sourceCode":"            \"item_type\": \"project\",\n            \"title\": entry.get(\"name\", \"\"),\n            \"subtitle\": entry.get(\"role\", \"\"),\n            \"current_description\": desc if isinstance(desc, list) else [desc] if isinstance(desc, str) and desc else [],\n        }\n    return {}\n\n\n@router.post(\"/analyze/{resume_id}\", response_model=AnalysisResponse)\nasync def analyze_resume(resume_id: str) -> AnalysisResponse:\n    \"\"\"Analyze a resume to identify items that need enrichment.\n\n    Uses AI to examine Experience and Projects sections for weak,\n    vague, or incomplete descriptions and generates clarifying questions.\n    \"\"\"\n    # Fetch resume\n    resume = await db.get_resume(resume_id)\n    if not resume:\n        raise HTTPException(status_code=404, detail=\"Resume not found\")\n\n    # Get processed data\n    processed_data = resume.get(\"processed_data\")\n    if not processed_data:\n        raise HTTPException(\n            status_code=400,\n            detail=\"Resume has no processed data. Please re-upload the resume.\",\n        )\n\n    # Build prompt with content language\n    resume_json = json.dumps(processed_data)\n    language = get_content_language()\n    output_language = get_language_name(language)\n    prompt = ANALYZE_RESUME_PROMPT.format(\n        resume_json=resume_json,\n        output_language=output_language\n    )\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/srbhr/Resume-Matcher/blob/116f9cc3b00e1ac91734a6c2679bf41ea64a0edc/apps/backend/app/routers/enrichment.py#L79-L115","documentation":"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.","triggerScenarios":"POSTing to the enrichment analyze endpoint with a resume_id that does not exist in the database (deleted resume, wrong ID, wrong database/environment).","commonSituations":"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.","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"],"exampleFix":"// before\nawait analyzeResume('abc123')  // deleted id\n// after\nconst resumes = await listResumes();\nawait analyzeResume(resumes[0].id)","handlingStrategy":"validation","validationCode":"const resume = await api.getResume(resumeId);\nif (!resume) throw new Error(`Resume ${resumeId} not found`);","typeGuard":"function resumeExists(r) { return r != null && typeof r.id === 'string'; }","tryCatchPattern":"try { await api.analyzeResume(id); } catch (e) { if (e.status === 404) { await refreshResumeList(); } else throw e; }","preventionTips":["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"],"tags":["http","not-found","resume","rest"],"backgroundTag":"resource-not-found","analyzedSha":"116f9cc3b00e1ac91734a6c2679bf41ea64a0edc","analyzedAt":"2026-08-28T22:51:40.999Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}