FlowiseAI/Flowise · error · Error
${e}
Error message
${e} What it means
SimpleStore's `add` path builds a LlamaIndex `VectorStoreIndex` from documents against a sanitized `basePath` and wraps any thrown value as `new Error(e)`. Failures come from LlamaIndex's `fromDocuments`/`storageContext` layer: persist directory permission errors, embedding/LLM model errors, or serialization failures. The re-wrap loses the original stack.
Source
Thrown at packages/components/nodes/vectorstores/SimpleStore/SimpleStore.ts:111
for (let i = 0; i < flattenDocs.length; i += 1) {
finalDocs.push(new LCDocument(flattenDocs[i]))
}
const llamadocs: Document[] = []
for (const doc of finalDocs) {
llamadocs.push(new Document({ text: doc.pageContent, metadata: doc.metadata }))
}
const serviceContext = serviceContextFromDefaults({ llm: model, embedModel: embeddings })
// Validate and sanitize the base path to prevent path traversal attacks
const filePath = validateVectorStorePath(basePath)
const storageContext = await storageContextFromDefaults({ persistDir: filePath })
try {
await VectorStoreIndex.fromDocuments(llamadocs, { serviceContext, storageContext })
return { numAdded: finalDocs.length, addedDocs: finalDocs }
} catch (e) {
throw new Error(e)
}
}
}
async init(nodeData: INodeData): Promise<any> {
const basePath = nodeData.inputs?.basePath as string
const embeddings = nodeData.inputs?.embeddings
const model = nodeData.inputs?.model
const topK = nodeData.inputs?.topK as string
const k = topK ? parseFloat(topK) : 4
// Validate and sanitize the base path to prevent path traversal attacks
const filePath = validateVectorStorePath(basePath)
const serviceContext = serviceContextFromDefaults({ llm: model, embedModel: embeddings })
const storageContext = await storageContextFromDefaults({ persistDir: filePath })
const index = await VectorStoreIndex.init({ storageContext, serviceContext })View on GitHub (pinned to abe4a8601a)
Solutions
- Ensure `basePath` resolves to a writable, absolute directory and passes path validation.
- Confirm the `embeddings` and `model` inputs are valid LlamaIndex model instances.
- Free disk space and fix directory ownership/permissions on the persist dir.
- Reproduce `VectorStoreIndex.fromDocuments` standalone to surface the original error.
Example fix
// before
catch (e) { throw new Error(e) }
// after
catch (e) { throw new Error(`SimpleStore indexing failed: ${e instanceof Error ? e.message : String(e)}`, { cause: e }) } Defensive patterns
Strategy: try-catch
Validate before calling
function validateSimpleStoreInputs(inputs: any) {
if (!inputs?.basePath) throw new Error('basePath is required')
if (!inputs?.embeddings) throw new Error('embeddings is required')
// validateVectorStorePath already guards traversal; ensure writability
} Type guard
null
Try / catch
try { await VectorStoreIndex.fromDocuments(llamadocs, { serviceContext, storageContext }) }
catch (e) { throw new Error(`SimpleStore index failed: ${e instanceof Error ? e.message : String(e)}`, { cause: e }) } Prevention
- Use an absolute, writable basePath.
- Confirm embeddings/model are valid LlamaIndex instances.
- Run the worker with write permission to the persist dir.
- Reproduce fromDocuments standalone to surface the real error.
When it happens
Trigger: `basePath` not writable or fails `validateVectorStorePath`; embedding/LLM model misconfigured in `serviceContext`; disk full / permission denied writing the persist dir; LlamaIndex version incompatibility raising during index build.
Common situations: Running as a user without write permission to basePath; relative basePath resolved against an unexpected cwd; model input missing or wrong type; persist dir locked by another process.
Related errors
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/b43e1043e7af5456.
Report an issue: GitHub.