{"record":{"id":"d8a437579a0f29d4","repo":"srbhr/Resume-Matcher","slug":"resume-has-no-processed-data-please-re-upload-the","errorCode":null,"errorMessage":"Resume has no processed data. Please re-upload the resume.","messagePattern":"Resume has no processed data\\. Please re-upload the resume\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"apps/backend/app/routers/enrichment.py","lineNumber":102,"sourceCode":"    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\n    try:\n        # Call LLM with increased max_tokens for non-English languages\n        result = await asyncio.wait_for(\n            complete_json(prompt, max_tokens=8192, schema_type=\"enrichment\"),\n            timeout=180.0,  # 3-minute hard limit","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/srbhr/Resume-Matcher/blob/116f9cc3b00e1ac91734a6c2679bf41ea64a0edc/apps/backend/app/routers/enrichment.py#L84-L120","documentation":"Raised by analyze_resume in apps/backend/app/routers/enrichment.py when the resume exists but its processed_data field is empty/missing. The analysis prompt is built from processed_data, so without it the endpoint returns 400 and asks the user to re-upload.","triggerScenarios":"Calling analyze on a resume whose processing/parsing step never completed or stored no processed_data (failed upload pipeline, legacy record created before processed_data was introduced, or manual DB insertion).","commonSituations":"Resumes migrated from an older schema without processed_data; uploads that failed after the record row was created; DB partially reset losing the processed payload.","solutions":["Re-upload the resume so the processing pipeline regenerates processed_data","Check the upload/parse pipeline logs for the resume to see why processed_data was not saved","If it's a legacy record, reprocess it or migrate it to include processed_data","Guard client UX by checking processed_data presence before calling analyze"],"exampleFix":"// before\nif (!resume.processedData) await analyzeResume(resume.id)\n// after\nif (!resume.processedData) { await reuploadResume(file); } else { await analyzeResume(resume.id); }","handlingStrategy":"validation","validationCode":"const resume = await api.getResume(resumeId);\nif (!resume?.processed_data) throw new Error('Resume has no processed data; re-upload required');","typeGuard":"function hasProcessedData(r) { return r != null && r.processed_data != null && Object.keys(r.processed_data).length > 0; }","tryCatchPattern":"try { await api.analyzeResume(id); } catch (e) { if (e.status === 400 && /processed data/.test(e.detail)) { await promptReupload(); } else throw e; }","preventionTips":["Verify upload pipeline completed (processed_data stored) before enabling analyze UI","Reprocess or re-upload legacy records lacking processed_data","Monitor the upload job status before offering enrichment","Validate resume documents after DB migrations"],"tags":["http","validation","resume","data-integrity"],"backgroundTag":"missing-processed-data","analyzedSha":"116f9cc3b00e1ac91734a6c2679bf41ea64a0edc","analyzedAt":"2026-08-28T22:51:40.999Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}