zylon-ai/private-gpt · error · RuntimeError
Failed to load file '{file_info.file_name}' with readers: {a
Error message
Failed to load file '{file_info.file_name}' with readers: {available} What it means
ReaderComponent's file-loading loop tries every reader name registered for the file, collects nodes, and remembers exceptions; when every reader either raised or returned zero nodes and at least one exception occurred, it raises RuntimeError chaining the last exception (`from last_exception`). The message lists which readers were attempted, so you know the candidate set was tried and exhausted. The root cause is always in the chained exception — inspect `__cause__` for the real failure.
Source
Thrown at private_gpt/components/readers/reader_component.py:103
nodes: list[BaseNode] = []
async for node in loader.lazy_load_data(
file_info,
extra_info=extra_info,
**load_kwargs,
):
nodes.append(node)
if nodes:
return nodes
logger.info(
"Reader '%s' returned no nodes for file: %s",
reader_name,
file_info.file_name,
)
if last_exception is not None:
available = ", ".join(reader_names)
raise RuntimeError(
f"Failed to load file '{file_info.file_name}' with readers: {available}"
) from last_exception
return []
def register_reader_factory(self, name: str, factory: ReaderFactory) -> None:
self.factory_registry.register_factory(name, factory)
def unregister_reader_factory(self, name: str) -> None:
self.factory_registry.unregister_factory(name)
def register_extension_reader(self, extension: str, reader_name: str) -> None:
self.factory_registry.get_factory(reader_name)
self.registry.register_extension_reader(extension, reader_name)
def register_extension_readers(
self,
extension: str,View on GitHub (pinned to 4a030776a3)
Solutions
- Inspect the chained exception (`exc.__cause__`) — the RuntimeError is only an aggregate; fix the underlying reader error it reports.
- Open the file manually with the corresponding reader dependency (e.g. a PDF library) to verify it is not corrupt or encrypted.
- Confirm the optional extras for every reader listed in `available` are installed.
- If the file may be malformed, add a pre-ingestion validation/quarantine step so unusable files never enter the pipeline.
Example fix
# before
try:
nodes = component.load_file(file_info, reader_names)
except RuntimeError as e:
logger.error(str(e)) # loses root cause
# after
try:
nodes = component.load_file(file_info, reader_names)
except RuntimeError as e:
logger.error("Ingestion failed: %s", e)
logger.error("Root cause: %r", e.__cause__) Defensive patterns
Strategy: try-catch
Try / catch
try:
nodes = component.load_file(file_info, reader_names)
except RuntimeError as e:
cause = e.__cause__
logger.error("All readers failed for %s: %s", file_info.file_name, e)
if isinstance(cause, ImportError):
... # dependency problem: fix environment
else:
... # file problem: quarantine the file
raise Prevention
- Always log e.__cause__ — the aggregate message hides the real error.
- Quarantine files that fail ingestion instead of retrying them in a loop.
- Pre-validate files (openable, non-encrypted) before submitting to the reader pipeline.
When it happens
Trigger: Calling the file-loading API (the method around line 103 in reader_component.py) for a file where every registered reader throws — e.g. a corrupt PDF, an unreadable/password-protected file, or a dependency failure inside each reader (see errors 200/201).
Common situations: Corrupt or truncated downloads; password-protected or DRM-protected PDFs/Office files; files with misleading extensions; optional reader dependencies missing so all candidate readers fail on import; permission errors on the storage path.
Related errors
- Failed to convert {file_info.file_data} to {target_extension
- Invalid system item in list (dict): {item}
- Invalid system item in list: {item}
- Invalid system specification: {system}
- No content could be extracted from document source (type={do
AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15).
Data as JSON: /api/errors/814723d56d36022d.
Report an issue: GitHub.