zylon-ai/private-gpt · error · InvalidFileError
zpgt.ingest.parsing_failure.error
zpgt.ingest.parsing_failure.error
Error message
zpgt.ingest.parsing_failure.error
What it means
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.
Source
Thrown at private_gpt/components/ingest/parse_component.py:121
)
except ExtractionUnsuccessfulError as e:
logger.warning("Extraction unsuccessful for %s: %s", file_info.file_name, e)
try:
vision_nodes = self._extract_with_vision_fallback(
converted_file,
file_metadata,
notification=notification,
warnings=warnings,
)
except Exception as vision_error:
# Vision reader was available but failed during extraction
logger.error(
"Vision reader fallback failed for %s: %s",
file_info.file_name,
vision_error,
exc_info=True,
)
raise InvalidFileError(
errors=[IngestionParseErrors.PARSING_FAILURE],
warnings=warnings,
) from vision_error
if vision_nodes:
nodes = vision_nodes
else:
raise InvalidFileError(
errors=[IngestionParseErrors.PARSING_FAILURE],
warnings=warnings,
) from e
except RuntimeError as e:
raise InvalidFileError(errors=[IngestionParseErrors.PARSING_FAILURE]) from e
except Exception as e:
logger.error("Error loading file: %s", e, exc_info=True)
converted_fallback = convert_unsupported_file_as_fallback(file_info)
if converted_fallback:View on GitHub (pinned to 4a030776a3)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try:
result = ingest_component.parse_file(file_data, file_metadata)
except InvalidFileError as e:
if "zpgt.ingest.parsing_failure.error" in e.errors:
# inspect e.__cause__ chain: vision error vs original extraction error
logger.warning("parse failed: %s", e.__cause__)
return reject_upload("unsupported_or_corrupt_document") Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- zpgt.ingest.no_valid_files.error
- Error reading delimited file: {e}
- Invalid system item in list (dict): {item}
- Invalid system item in list: {item}
- Invalid system specification: {system}
AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15).
Data as JSON: /api/errors/61c86385ab6c2553.
Report an issue: GitHub.