{"record":{"id":"29b9795370e718e2","repo":"run-llama/llama_index","slug":"no-files-found-in-input-dir","errorCode":null,"errorMessage":"No files found in {input_dir}.","messagePattern":"No files found in (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/readers/file/base.py","lineNumber":425,"sourceCode":"                            rejected_dir,\n                        )\n                        break\n\n            if (\n                is_dir\n                or skip_because_hidden\n                or skip_because_bad_ext\n                or skip_because_excluded\n                or skip_because_empty\n            ):\n                continue\n            else:\n                all_files.add(ref)\n\n        new_input_files = sorted(all_files)\n\n        if len(new_input_files) == 0:\n            raise ValueError(f\"No files found in {input_dir}.\")\n\n        # print total number of files added\n        logger.debug(\n            f\"> [SimpleDirectoryReader] Total files added: {len(new_input_files)}\"\n        )\n\n        return new_input_files\n\n    def _exclude_metadata(self, documents: list[Document]) -> list[Document]:\n        \"\"\"\n        Exclude metadata from documents.\n\n        Args:\n            documents (List[Document]): List of documents.\n\n        \"\"\"\n        for doc in documents:\n            # Keep only metadata['file_path'] in both embedding and llm content","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/readers/file/base.py#L407-L443","documentation":"Raised by SimpleDirectoryReader._add_files when, after walking input_dir, zero files survived the filters. Files are skipped when they are hidden (dot-prefixed parts), have a bad extension (not in required_exts or in exclude), match the exclude glob, or are empty (recursive case). The error means the directory exists but nothing in it is eligible for ingestion.","triggerScenarios":"Passing required_exts=['.pdf'] to a directory containing only .txt/.docx files; using exclude patterns that match everything; pointing at a directory that only contains hidden dotfiles or empty subdirectories with only empty files; a directory whose files are all 0 bytes.","commonSituations":"Data exported to a different format than expected; case-sensitivity mistakes such as required_exts=['.PDF'] on Linux while files are named .pdf; recursive=True against a tree where only hidden config files exist; overly broad exclude='**' patterns.","solutions":["List what would be ingested: check the directory contents and compare extensions case-sensitively against required_exts (include both '.pdf' and '.PDF' or normalize).","Loosen or remove exclude/recursive filters to confirm they are not removing everything.","If files are empty (0 bytes), fix the upstream export/copy step that produced them.","Pass input_files=[...] explicitly if you know the exact files you want, bypassing directory filtering."],"exampleFix":"# before\nreader = SimpleDirectoryReader(input_dir=\"./docs\", required_exts=[\".PDF\"])\n\n# after\nreader = SimpleDirectoryReader(\n    input_dir=\"./docs\",\n    required_exts=[\".pdf\", \".PDF\"],\n)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nexts = {p.suffix.lower() for p in Path(\"./docs\").rglob(\"*\") if p.is_file()}\nassert exts, \"no files found\"\nassert \".pdf\" in exts, f\"no .pdf files; found: {exts}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compare extensions case-insensitively against required_exts.","Smoke-test the directory listing before building the index.","Prefer input_files for small known file sets to bypass filtering."],"tags":["filesystem","filtering","directory-reader","empty-input"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}