{"record":{"id":"afe6a41518a0bff6","repo":"zylon-ai/private-gpt","slug":"zpgt-ingest-no-valid-files-error","errorCode":"zpgt.ingest.no_valid_files.error","errorMessage":"zpgt.ingest.no_valid_files.error","messagePattern":"zpgt\\.ingest\\.no_valid_files\\.error","errorType":"error_code","errorClass":"InvalidFileError","httpStatus":400,"severity":"error","filePath":"private_gpt/components/ingest/parse_component.py","lineNumber":158,"sourceCode":"                resolved_reader = self._resolve_reader(converted_fallback.extension)\n                if notification:\n                    notification(\n                        percentage=0,\n                        warnings=[IngestionParseErrors.FALLBACK_TO_PDF_TO_TEXT],\n                    )\n                nodes = self._load_data(\n                    converted_fallback,\n                    file_metadata,\n                    notification=notification,\n                    warnings=warnings,\n                    reader_name=resolved_reader,\n                )\n            else:\n                nodes = []\n\n        if not nodes:\n            logger.info(\"No valid nodes found in the file.\")\n            raise InvalidFileError(\n                errors=[IngestionLoadErrors.NO_VALID_FILES], warnings=warnings\n            )\n\n        return FileParseResult(nodes=nodes, reader=resolved_reader)\n\n    def _resolve_reader(self, extension: str | None) -> str:\n        names = self.reader_component.get_reader_names(extension=extension or \"\")\n        return names[0] if names else \"text\"\n\n    def _get_file_info(\n        self,\n        file_data: Path,\n        file_metadata: dict[str, Any] | None,\n        progress: NotifyProtocol | None = None,\n    ) -> FileInfo:\n        file_name = get_file_name(file_metadata) or file_data.name\n        return get_file_info(file_data, file_name=file_name, progress=progress)\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/ingest/parse_component.py#L140-L176","documentation":"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 []).","triggerScenarios":"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 [].","commonSituations":"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.","solutions":["Verify the uploaded file is non-empty and contains real content before ingest.","Check the temp-file path used by the ingest worker is not being truncated/cleaned mid-ingest.","Confirm the file extension is supported by a registered reader (check reader_component.get_reader_names).","If content is images only, ensure the vision fallback path is enabled so text can be OCR'd into nodes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\nif os.path.getsize(path) == 0:\n    raise ValueError('refusing to ingest empty file')","typeGuard":null,"tryCatchPattern":"try:\n    result = parse_component.file_to_nodes(file_info)\nexcept InvalidFileError as e:\n    if \"zpgt.ingest.no_valid_files.error\" in e.errors:\n        return api_error(422, 'File contained no ingestable content')","preventionTips":["Validate non-zero size and non-blank content at the API boundary before queuing ingest jobs.","Alert when the fallback-conversion path returns no nodes repeatedly — it usually signals broken conversions, not bad files."],"tags":["ingestion","empty-file","parsing","document-processing"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}