{"record":{"id":"a3621b30ddc9097d","repo":"crewAIInc/crewAI","slug":"document-parsing-failed","errorCode":null,"errorMessage":"Document parsing failed","messagePattern":"Document parsing failed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/contextualai_parse_tool/contextual_parse_tool.py","lineNumber":95,"sourceCode":"\n            with open(file_path, \"rb\") as fp:\n                file = {\"raw_file\": fp}\n                result = requests.post(\n                    url, headers=headers, data=config, files=file, timeout=30\n                )\n                response = json.loads(result.text)\n                job_id = response[\"job_id\"]\n\n            # Monitor job status\n            status_url = f\"{base_url}/parse/jobs/{job_id}/status\"\n            while True:\n                result = requests.get(status_url, headers=headers, timeout=30)\n                parse_response = json.loads(result.text)[\"status\"]\n\n                if parse_response == \"completed\":\n                    break\n                if parse_response == \"failed\":\n                    raise RuntimeError(\"Document parsing failed\")\n\n                sleep(5)\n\n            results_url = f\"{base_url}/parse/jobs/{job_id}/results\"\n            result = requests.get(\n                results_url,\n                headers=headers,\n                params={\"output_types\": \",\".join(output_types)},\n                timeout=30,\n            )\n\n            return json.dumps(json.loads(result.text), indent=2)\n\n        except Exception as e:\n            return f\"Failed to parse document: {e!s}\"\n","sourceCodeStart":77,"sourceCodeEnd":111,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/contextualai_parse_tool/contextual_parse_tool.py#L77-L111","documentation":"Error \"Document parsing failed\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai-tools/src/crewai_tools/tools/contextualai_parse_tool/contextual_parse_tool.py:95 when the library encounters an invalid state.","commonSituations":"Occurs when the Contextual AI parse API fails to parse the document. Check the document format is supported and the API credentials are valid.","solutions":["Check that the document is a supported format (PDF, etc.) and not corrupted.","Verify your Contextual AI API key and account limits."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}