{"record":{"id":"380fb7943ed1e8a4","repo":"Mintplex-Labs/anything-llm","slug":"could-not-embed-document-chunks-this-document-wil-380fb7","errorCode":null,"errorMessage":"Could not embed document chunks! This document will not be recorded.","messagePattern":"Could not embed document chunks! This document will not be recorded\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/vectorDbProviders/weaviate/index.js","lineNumber":321,"sourceCode":"          const vectorRecord = {\n            class: camelCase(namespace),\n            id: uuidv4(),\n            vector: vector,\n            // [DO NOT REMOVE]\n            // LangChain will be unable to find your text if you embed manually and dont include the `text` key.\n            // https://github.com/hwchase17/langchainjs/blob/5485c4af50c063e257ad54f4393fa79e0aff6462/langchain/src/vectorstores/weaviate.ts#L133\n            properties: { ...flattenedMetadata, text: textChunks[i] },\n          };\n\n          submission.ids.push(vectorRecord.id);\n          submission.vectors.push(vectorRecord.values);\n          submission.properties.push(metadata);\n\n          vectors.push(vectorRecord);\n          documentVectors.push({ docId, vectorId: vectorRecord.id });\n        }\n      } else {\n        throw new Error(\n          \"Could not embed document chunks! This document will not be recorded.\"\n        );\n      }\n\n      const { client } = await this.connect();\n      const weaviateClassExits = await this.hasNamespace(namespace);\n      if (!weaviateClassExits) {\n        await client.schema\n          .classCreator()\n          .withClass({\n            class: camelCase(namespace),\n            description: `Class created by AnythingLLM named ${camelCase(\n              namespace\n            )}`,\n            vectorizer: \"none\",\n          })\n          .do();\n      }","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/vectorDbProviders/weaviate/index.js#L303-L339","documentation":"On the novel-document path, pageContent is split into chunks and EmbedderEngine.embedChunks(textChunks) is called. If that returns null/undefined or an empty array (the `!!vectorValues && vectorValues.length > 0` check fails), the code refuses to record the document and throws. The failure is in the embedding engine layer, before Weaviate is ever contacted.","triggerScenarios":"Embedding engine unconfigured or misselected in admin settings; embedder API key invalid, quota exhausted, or endpoint unreachable so embedChunks yields nothing; the document produced zero text chunks (empty extraction); local embedding runtime missing on the host.","commonSituations":"Default OpenAI embedder kept while OPEN_AI_KEY was never set; switching embedder providers without re-verifying credentials; uploading an empty or unparseable file (0 chunks); all-native/local embedder binary not installed; embedder service temporarily down.","solutions":["Open Admin settings and re-verify the embedding engine selection and its API key/endpoint, then save","Test the embedder directly (e.g. curl the provider /embeddings endpoint) with the configured credentials","Check document processing logs for 'Snippets created from document: 0' — an empty extraction also produces no vectors","After fixing/changing the embedder, re-upload the document so fresh chunks and vectors are generated"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const embedder = getEmbeddingEngineSelection();\nif (!embedder) throw new Error(\"No embedding engine configured — set one in admin settings\");\nconst chunks = await textSplitter.splitText(pageContent);\nif (chunks.length === 0) throw new Error(\"Document produced no text chunks\");\nconst vectors = await embedder.embedChunks(chunks);\nif (!vectors?.length) throw new Error(\"Embedder returned no vectors — check credentials\");","typeGuard":null,"tryCatchPattern":"const { vectorized, error } = await provider.addDocumentToNamespace(...);\nif (!vectorized && /Could not embed document chunks/.test(String(error)))\n  haltIngestion(\"Embedding engine failure — verify provider config before retrying\", error);","preventionTips":["Block ingestion at the start if no embedding engine is selected or its credential test fails","Smoke-test the embedder with a one-chunk request before batch-processing documents","Alert on zero-chunk extractions so empty files fail loudly with their own message"],"tags":["weaviate","vector-db","embedding","embedder","configuration"],"backgroundTag":"embedding-request-failed","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}