{"record":{"id":"725457b136aecb19","repo":"feder-cr/Jobs_Applier_AI_Agent_AIHawk","slug":"section-section-name-not-found-in-either-resum","errorCode":null,"errorMessage":"Section '{section_name}' not found in either resume or job_application_profile.","messagePattern":"Section '(.+?)' not found in either resume or job_application_profile\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/libs/llm_manager.py","lineNumber":596,"sourceCode":"            chain = chains.get(section_name)\n            raw_output = chain.invoke(\n                {\n                    RESUME: self.resume,\n                    JOB_DESCRIPTION: self.job_description,\n                    COMPANY: self.job.company,\n                }\n            )\n            output = self._clean_llm_output(raw_output)\n            logger.debug(f\"Cover letter generated: {output}\")\n            return output\n        resume_section = getattr(self.resume, section_name, None) or getattr(\n            self.job_application_profile, section_name, None\n        )\n        if resume_section is None:\n            logger.error(\n                f\"Section '{section_name}' not found in either resume or job_application_profile.\"\n            )\n            raise ValueError(\n                f\"Section '{section_name}' not found in either resume or job_application_profile.\"\n            )\n        chain = chains.get(section_name)\n        if chain is None:\n            logger.error(f\"Chain not defined for section '{section_name}'\")\n            raise ValueError(f\"Chain not defined for section '{section_name}'\")\n        raw_output = chain.invoke(\n            {RESUME_SECTION: resume_section, QUESTION: question}\n        )\n        output = self._clean_llm_output(raw_output)\n        logger.debug(f\"Question answered: {output}\")\n        return output\n\n    def answer_question_numeric(\n        self, question: str, default_experience: str = 3\n    ) -> str:\n        logger.debug(f\"Answering numeric question: {question}\")\n        func_template = self._preprocess_template_string(","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/feder-cr/Jobs_Applier_AI_Agent_AIHawk/blob/79155b52faccfbd19b834680af285eac70dd2df4/src/libs/llm_manager.py#L578-L614","documentation":"After a section name is extracted from the LLM reply, the code looks the section up with getattr on both the resume object and job_application_profile. If both lookups return None, the section genuinely does not exist in the user's data, and the ValueError is raised with the offending section name.","triggerScenarios":"The LLM classifies a question under a section (e.g. 'certifications') that is absent from both the resume YAML and the job application profile, so getattr(resume, 'certifications', None) and getattr(job_application_profile, ...) are both None.","commonSituations":"Sparse resumes missing optional sections, resume schema changes that renamed fields, or an LLM misclassification into a section the user never filled in.","solutions":["Add the missing section to your resume YAML / job_application_profile data so the lookup succeeds.","Make the section lookup fall back to a sensible default (e.g. personal_info) instead of raising.","If sections were renamed in a schema update, re-generate or migrate the resume/profile objects."],"exampleFix":"# before\nresume:  # no certifications key\n# after\nresume:\n  certifications: \"AWS Solutions Architect 2023\"","handlingStrategy":"validation","validationCode":"SECTION_FIELDS = {'personal_info','skills','education','experience_details','projects','availability','salary_expectations','certifications','languages','interests','cover_letter'}\nmissing = [s for s in SECTION_FIELDS if getattr(resume, s, None) is None and getattr(profile, s, None) is None]\n# sections in `missing` will raise if the LLM picks them","typeGuard":"def has_section(resume, profile, name: str) -> bool:\n    return getattr(resume, name, None) is not None or getattr(profile, name, None) is not None","tryCatchPattern":"try:\n    ans = llm_manager.answer_question_textual_wide_range(q)\nexcept ValueError as e:\n    if 'not found in either resume' in str(e):\n        ans = default_answer(q)  # fallback, e.g. skip the question\n    else:\n        raise","preventionTips":["Keep optional sections present (even if empty strings) in the resume YAML.","Audit your resume/profile objects for the recognized section attributes before a job run."],"tags":["python","llm","missing-data","resume-section"],"backgroundTag":"required-field-missing","analyzedSha":"79155b52faccfbd19b834680af285eac70dd2df4","analyzedAt":"2026-08-28T14:10:26.659Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}