{"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":null,"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/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/agents/aibitat/plugins/summarize.js#L115-L151","documentation":"Thrown by the summarize plugin when a document exists in the workspace (filename resolves to a docInfo) but Document.content returns null/empty after fetching it by document_id. The plugin refuses to summarize a document whose text was never extracted/stored, so the agent gets an abort instead of a fabricated summary.","triggerScenarios":"The file was uploaded but embedding/processing never ran or failed, leaving document content empty in storage; the document is image/scanned-only with no text layer; the document record was created by an API integration that skipped content extraction; storage dir wiped but DB rows remain.","commonSituations":"Documents moved to a workspace 'as reference' without being embedded; collector failures during bulk upload; anythingllm storage volume remounted while the database kept old document rows.","solutions":["Open the document in the AnythingLLM UI and verify it shows text; if empty, re-upload or re-save it so the collector extracts content.","Trigger embedding/processing for that document (save-and-embed) and retry summarization afterwards.","Verify storage consistency: document rows in the DB must match files present under STORAGE_DIR/documents."],"exampleFix":"// before\ndocument_summarizer({ filename: \"scan.pdf\" })  // uploaded but never processed -> throws\n\n// after (process once, then summarize)\nawait embedAndStoreDocument(workspace, file);  // re-run collector\ndocument_summarizer({ filename: \"scan.pdf\" })","handlingStrategy":"validation","validationCode":"const document = await Document.content(docInfo.document_id);\nif (!document?.content || document.content.length === 0) {\n  // do not call the summarizer; prompt re-processing instead\n  return \"Document has no extracted text. Re-upload or re-embed it, then retry summarization.\";\n}","typeGuard":"/** @returns {boolean} */\nfunction isSummarizable(doc) {\n  return !!doc && typeof doc.content === \"string\" && doc.content.trim().length > 0;\n}","tryCatchPattern":"try {\n  return await summarizeDocument(docInfo, filename);\n} catch (e) {\n  if (e.message === \"This document has no readable content that could be found.\") {\n    return `\"${filename}\" has no extracted text. Embed/process the document first, then ask again.`;\n  }\n  throw e;\n}","preventionTips":["Check Document.content is non-empty before exposing documents to summarizer-capable agents.","Embed documents at upload time and surface collector failures immediately.","Keep DB document rows and STORAGE_DIR/documents in sync; treat orphans as missing content."],"tags":["summarize","document","rag","empty-content","agent-tools"],"backgroundTag":"empty-document-content","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}