zylon-ai/private-gpt · error · InvalidFileError

zpgt.ingest.no_valid_files.error

zpgt.ingest.no_valid_files.error

Error message

zpgt.ingest.no_valid_files.error

What it means

Raised as InvalidFileError with code zpgt.ingest.no_valid_files.error after loading completed but produced zero nodes. This triggers when _load_data returns an empty list, the generic-exception fallback path converted the file and still got no nodes, or the fallback path had no conversion available (nodes set to []).

Source

Thrown at private_gpt/components/ingest/parse_component.py:158

                resolved_reader = self._resolve_reader(converted_fallback.extension)
                if notification:
                    notification(
                        percentage=0,
                        warnings=[IngestionParseErrors.FALLBACK_TO_PDF_TO_TEXT],
                    )
                nodes = self._load_data(
                    converted_fallback,
                    file_metadata,
                    notification=notification,
                    warnings=warnings,
                    reader_name=resolved_reader,
                )
            else:
                nodes = []

        if not nodes:
            logger.info("No valid nodes found in the file.")
            raise InvalidFileError(
                errors=[IngestionLoadErrors.NO_VALID_FILES], warnings=warnings
            )

        return FileParseResult(nodes=nodes, reader=resolved_reader)

    def _resolve_reader(self, extension: str | None) -> str:
        names = self.reader_component.get_reader_names(extension=extension or "")
        return names[0] if names else "text"

    def _get_file_info(
        self,
        file_data: Path,
        file_metadata: dict[str, Any] | None,
        progress: NotifyProtocol | None = None,
    ) -> FileInfo:
        file_name = get_file_name(file_metadata) or file_data.name
        return get_file_info(file_data, file_name=file_name, progress=progress)

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Verify the uploaded file is non-empty and contains real content before ingest.
  2. Check the temp-file path used by the ingest worker is not being truncated/cleaned mid-ingest.
  3. Confirm the file extension is supported by a registered reader (check reader_component.get_reader_names).
  4. If content is images only, ensure the vision fallback path is enabled so text can be OCR'd into nodes.
Defensive patterns

Strategy: validation

Validate before calling

import os
if os.path.getsize(path) == 0:
    raise ValueError('refusing to ingest empty file')

Try / catch

try:
    result = parse_component.file_to_nodes(file_info)
except InvalidFileError as e:
    if "zpgt.ingest.no_valid_files.error" in e.errors:
        return api_error(422, 'File contained no ingestable content')

Prevention

When it happens

Trigger: Ingesting an empty file (0 bytes), a file whose extension maps to a reader that yields nothing (empty .txt, empty .csv), or a fallback conversion that returns no nodes. Also hit when convert_unsupported_file_as_fallback returns None for the failing format so nodes is hard-set to [].

Common situations: User uploads an empty document or one containing only whitespace; a spreadsheet with no rows; upload pipeline truncation producing 0-byte temp files; unsupported extension with no PDF fallback.

Related errors


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/afe6a41518a0bff6. Report an issue: GitHub.