{"record":{"id":"5f92814dc6f0781f","repo":"Mintplex-Labs/anything-llm","slug":"this-document-has-no-readable-content-that-could-b","errorCode":null,"errorMessage":"This document has no readable content that could be found.","messagePattern":"This document has no readable content that could be found\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/utils/agents/aibitat/plugins/summarize.js","lineNumber":133,"sourceCode":"              const docInfo = availableDocs.find(\n                (info) => info.filename === filename\n              );\n              if (!docInfo) {\n                this.super.handlerProps.log(\n                  `${this.caller}: No available document by the name \"${filename}\".`\n                );\n                return `No available document by the name \"${filename}\".`;\n              }\n\n              const document = await Document.content(docInfo.document_id);\n              this.super.introspect(\n                `${this.caller}: Grabbing all content for ${\n                  filename ?? \"a discovered file.\"\n                }`\n              );\n\n              if (!document.content || document.content.length === 0) {\n                throw new Error(\n                  \"This document has no readable content that could be found.\"\n                );\n              }\n\n              // Report citation for the document being summarized\n              this.super.addCitation?.({\n                id: docInfo.document_id,\n                title: document.title || filename,\n                text: document.content,\n                chunkSource: null,\n                score: null,\n              });\n\n              const { TokenManager } = require(\"../../../helpers/tiktoken\");\n              if (\n                new TokenManager(this.super.model).countFromString(\n                  document.content\n                ) < Provider.contextLimit(this.super.provider, this.super.model)","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/aibitat/plugins/summarize.js#L115-L151","documentation":"Thrown by the summarize agent plugin after fetching a document's content via Document.content(). If the returned document object has no content property or an empty string/array, the plugin cannot summarize anything and throws. This typically means the document was uploaded but its text extraction produced no results.","triggerScenarios":"Asking the agent to summarize a document whose text extraction yielded nothing — a scanned PDF with no OCR layer, a corrupt file, an image-only document, or a file type the parser does not support. The document record exists (it was found by filename) but its content field is empty.","commonSituations":"User uploads a scanned PDF expecting text but no OCR was configured; a .heic or proprietary format that the text extractor silently skipped; a previous extraction job failed mid-way leaving an empty content field; the document was embedded via vector but the raw text was purged.","solutions":["Open the document in the UI and verify it has extractable text — re-upload or re-process it if the content is empty.","If the file is a scanned image or PDF, enable OCR or convert to a text-based format before uploading.","Check server logs for text-extraction errors during the original upload/import.","If content exists in the vector store but not in the document record, re-run the embedding/processing pipeline for that document.","Provide the agent with a different document that has verified text content."],"exampleFix":"// before\nif (!document.content || document.content.length === 0) {\n  throw new Error(\"This document has no readable content that could be found.\");\n}\n\n// caller/tool fix — return a user-friendly message instead of throwing\nif (!document.content || document.content.length === 0) {\n  return `The document \"${filename}\" has no readable text content. It may be a scanned image or unsupported file type. Try re-uploading with OCR enabled.`;\n}","handlingStrategy":"validation","validationCode":"// Check document content before invoking summarize\nconst doc = await Document.content(docId);\nif (!doc || !doc.content || doc.content.trim().length === 0) {\n  return `Document \"${filename}\" has no readable text. It may need re-processing or OCR.`;\n}\n// safe to summarize","typeGuard":"/** @param {{content?: string | string[]}} doc */\nfunction hasReadableContent(doc) {\n  if (!doc || !doc.content) return false;\n  if (Array.isArray(doc.content)) return doc.content.length > 0;\n  return typeof doc.content === \"string\" && doc.content.trim().length > 0;\n}","tryCatchPattern":"try {\n  const summary = await summarizeDocument(filename);\n  return summary;\n} catch (e) {\n  if (e.message.includes(\"no readable content\")) {\n    return `Cannot summarize \"${filename}\": the document has no extractable text. Try re-uploading with OCR enabled.`;\n  }\n  throw e;\n}","preventionTips":["Verify documents have text content after upload — check extraction success.","Enable OCR for scanned/image-based PDFs before they reach the agent.","Pre-filter documents with empty content before exposing them to the summarize tool.","Monitor text-extraction failures during document processing."],"tags":["summarize","document","text-extraction","agent-tool","data-quality"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}