{"record":{"id":"61c86385ab6c2553","repo":"zylon-ai/private-gpt","slug":"zpgt-ingest-parsing-failure-error-61c863","errorCode":"zpgt.ingest.parsing_failure.error","errorMessage":"zpgt.ingest.parsing_failure.error","messagePattern":"zpgt\\.ingest\\.parsing_failure\\.error","errorType":"error_code","errorClass":"InvalidFileError","httpStatus":400,"severity":"error","filePath":"private_gpt/components/ingest/parse_component.py","lineNumber":121,"sourceCode":"            )\n        except ExtractionUnsuccessfulError as e:\n            logger.warning(\"Extraction unsuccessful for %s: %s\", file_info.file_name, e)\n            try:\n                vision_nodes = self._extract_with_vision_fallback(\n                    converted_file,\n                    file_metadata,\n                    notification=notification,\n                    warnings=warnings,\n                )\n            except Exception as vision_error:\n                # Vision reader was available but failed during extraction\n                logger.error(\n                    \"Vision reader fallback failed for %s: %s\",\n                    file_info.file_name,\n                    vision_error,\n                    exc_info=True,\n                )\n                raise InvalidFileError(\n                    errors=[IngestionParseErrors.PARSING_FAILURE],\n                    warnings=warnings,\n                ) from vision_error\n\n            if vision_nodes:\n                nodes = vision_nodes\n            else:\n                raise InvalidFileError(\n                    errors=[IngestionParseErrors.PARSING_FAILURE],\n                    warnings=warnings,\n                ) from e\n        except RuntimeError as e:\n            raise InvalidFileError(errors=[IngestionParseErrors.PARSING_FAILURE]) from e\n        except Exception as e:\n            logger.error(\"Error loading file: %s\", e, exc_info=True)\n\n            converted_fallback = convert_unsupported_file_as_fallback(file_info)\n            if converted_fallback:","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/ingest/parse_component.py#L103-L139","documentation":"Raised as InvalidFileError with code zpgt.ingest.parsing_failure.error when the primary document reader raised ExtractionUnsuccessfulError and the vision-model fallback reader also failed during extraction. The original reader error and the vision error are both chained as __cause__. It means both the text-extraction path and the OCR/vision path could not parse the file.","triggerScenarios":"Ingesting a scanned/corrupted PDF or image-heavy document where the standard reader throws ExtractionUnsuccessfulError, _extract_with_vision_fallback is configured (vision LLM available), but the vision API call itself errors (network failure, invalid API key, model timeout, unsupported image payload).","commonSituations":"Vision LLM credentials missing or expired; vision model endpoint unreachable from the worker; corrupt PDFs that defeat both parsers; oversized pages rejected by the vision API; local deployment where multimodal extra was never installed.","solutions":["Check the chained exceptions in logs (logger.error prints vision_error with exc_info=True) to identify the underlying vision API failure and fix that (API key, endpoint, network).","Verify the document opens in a normal viewer; if corrupted, re-export or repair the source file before ingest.","Test the vision reader directly on a simple image to confirm the multimodal backend works.","If the file is text-based but malformed, try converting it to PDF via convert_unsupported_file before ingest."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = ingest_component.parse_file(file_data, file_metadata)\nexcept InvalidFileError as e:\n    if \"zpgt.ingest.parsing_failure.error\" in e.errors:\n        # inspect e.__cause__ chain: vision error vs original extraction error\n        logger.warning(\"parse failed: %s\", e.__cause__)\n        return reject_upload(\"unsupported_or_corrupt_document\")","preventionTips":["Health-check the vision LLM endpoint at startup so vision fallback failures surface before user uploads.","Reject uploads of files that fail a quick integrity check (PDF header, office magic bytes) before entering the pipeline."],"tags":["ingestion","parsing","vision-ocr","document-processing"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}