{
  "id": "llm/llamaindex-empty-node-from-parser",
  "signature": "ValueError: Cannot create Document from empty text. Node content is None or empty string.",
  "signature_zh": "ValueError：无法从空文本创建 Document。节点内容为 None 或空字符串。",
  "regex": "Cannot create Document from empty text.*Node content is None or empty",
  "domain": "llm",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "LlamaIndex document parser received a file or chunk with no extractable text, often from binary files (PDFs without OCR, images) or empty markdown sections.",
  "root_cause_type": "generic",
  "root_cause_zh": "LlamaIndex 文档解析器接收到无可提取文本的文件或块，通常来自二进制文件（无 OCR 的 PDF、图像）或空的 Markdown 部分。",
  "versions": [
    {
      "version": "llama-index==0.10.43",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "llama-index-core==0.10.43",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pypdf==4.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The pipeline may silently drop valid data if the error is not caught and logged; the empty node is still created but breaks downstream indexing.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Empty text is not a chunk size issue; the source file itself has no extractable content.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Conversion may still produce empty files for binary inputs; the root cause is lack of extractable text, not format.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add a filter to skip files with no text before parsing: `if not file_content.strip(): continue` in the ingestion loop.",
      "success_rate": 0.9,
      "how": "Add a filter to skip files with no text before parsing: `if not file_content.strip(): continue` in the ingestion loop.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a try-except block to catch the ValueError and log the file path for manual review: `try: doc = parser.parse(file); except ValueError as e: logger.warning(f'Skipping {file}: {e}')`",
      "success_rate": 0.95,
      "how": "Use a try-except block to catch the ValueError and log the file path for manual review: `try: doc = parser.parse(file); except ValueError as e: logger.warning(f'Skipping {file}: {e}')`",
      "condition": "",
      "sources": []
    },
    {
      "action": "For PDFs, enable OCR with `pypdf` or `pdfplumber` to extract text from scanned documents: `pip install pypdf[ocr]` and set `parser = SimpleDirectoryReader(required_exts=['.pdf'], file_extractor={'.pdf': PDFReader(ocr=True)})`",
      "success_rate": 0.85,
      "how": "For PDFs, enable OCR with `pypdf` or `pdfplumber` to extract text from scanned documents: `pip install pypdf[ocr]` and set `parser = SimpleDirectoryReader(required_exts=['.pdf'], file_extractor={'.pdf': PDFReader(ocr=True)})`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add a filter to skip files with no text before parsing: `if not file_content.strip(): continue` in the ingestion loop.",
    "Use a try-except block to catch the ValueError and log the file path for manual review: `try: doc = parser.parse(file); except ValueError as e: logger.warning(f'Skipping {file}: {e}')`",
    "For PDFs, enable OCR with `pypdf` or `pdfplumber` to extract text from scanned documents: `pip install pypdf[ocr]` and set `parser = SimpleDirectoryReader(required_exts=['.pdf'], file_extractor={'.pdf': PDFReader(ocr=True)})`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.llamaindex.ai/en/stable/module_guides/loading/documents/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}