FlowiseAI/Flowise · error · Error
${e}
Error message
${e} What it means
Thrown in Astra vectorStoreMethods.upsert as the catch-all around AstraDBVectorStore.fromDocuments. Covers DB connection, auth, collection, and document-insertion failures. Uses `throw new Error(e)` which coerces the underlying error to a string, losing the stack and type.
Source
Thrown at packages/components/nodes/vectorstores/Astra/Astra.ts:140
dimension: vectorDimension ?? 1536,
metric: similarityMetric ?? 'cosine'
}
}
}
const flattenDocs = docs && docs.length ? flatten(docs) : []
const finalDocs = []
for (let i = 0; i < flattenDocs.length; i += 1) {
if (flattenDocs[i] && flattenDocs[i].pageContent) {
finalDocs.push(new Document(flattenDocs[i]))
}
}
try {
await AstraDBVectorStore.fromDocuments(finalDocs, embeddings, astraConfig)
return { numAdded: finalDocs.length, addedDocs: finalDocs }
} catch (e) {
throw new Error(e)
}
}
}
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const embeddings = nodeData.inputs?.embeddings as Embeddings
const vectorDimension = nodeData.inputs?.vectorDimension as number
const similarityMetric = nodeData.inputs?.similarityMetric as 'cosine' | 'euclidean' | 'dot_product' | undefined
const astraCollection = nodeData.inputs?.astraCollection as string
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const expectedSimilarityMetric = ['cosine', 'euclidean', 'dot_product']
if (similarityMetric && !expectedSimilarityMetric.includes(similarityMetric)) {
throw new Error(`Invalid Similarity Metric should be one of 'cosine' | 'euclidean' | 'dot_product'`)
}
const clientConfig = {
token: credentialData?.applicationToken,View on GitHub (pinned to abe4a8601a)
Solutions
- Verify the Astra credential (applicationToken, dbEndPoint) in Flowise credential manager.
- Confirm vectorDimension matches the embeddings model (e.g. 1536 for text-embedding-ada-002).
- Ensure the collection exists and was created with the same vector dimension.
- Retry on transient failures; check DataStax status page for outages.
Example fix
// before similarityMetric = 'cosine' vectorDimension = 768 // but embeddings produce 1536 -> Astra rejects // after vectorDimension = 1536 // match the embeddings model
Defensive patterns
Strategy: try-catch
Validate before calling
async function preflightAstra(creds: any, vectorDimension: number, embeddings: any) {
if (!creds?.applicationToken) throw new Error('Astra applicationToken missing in credentials')
if (!creds?.dbEndPoint || !/^https?:\/\//.test(creds.dbEndPoint)) throw new Error('Astra dbEndPoint missing/invalid')
// probe embedding dimension with a tiny input if the model exposes it
if (typeof embeddings?.embedQuery === 'function') {
const v = await embeddings.embedQuery('dimension probe')
if (v.length !== vectorDimension) throw new Error(`Embedding dimension ${v.length} != configured vectorDimension ${vectorDimension}`)
}
} Type guard
const hasAstraCreds = (c: any): c is { applicationToken: string; dbEndPoint: string } =>
typeof c?.applicationToken === 'string' && typeof c?.dbEndPoint === 'string' && /^https?:\/\//.test(c.dbEndPoint) Try / catch
try { return await astraNode.vectorStoreMethods.upsert(nodeData, options) }
catch (e) {
const msg = (e as Error).message
if (/unauthor|401|token/i.test(msg)) throw new Error('Astra auth failed — check applicationToken')
if (/dimension|expected.*vector/i.test(msg)) throw new Error('vectorDimension mismatch — align with embeddings model')
if (/not found|collection/i.test(msg)) throw new Error('Astra collection missing or misconfigured')
throw e
} Prevention
- Verify applicationToken and dbEndPoint in Flowise credential manager.
- Keep vectorDimension in lockstep with the embeddings model output.
- Create the collection with the same dimension before first upsert.
- Retry transient network/5xx errors with backoff.
When it happens
Trigger: Invalid/expired application token; wrong dbEndPoint; collection does not exist or has mismatched vector dimension; embeddings dimension differs from the collection's configured vector dimension; network failure to Astra; rate limit from DataStax.
Common situations: Astra credentials not bound or expired; endpoint URL wrong; vectorDimension input does not match the embedding model output; collection created with a different dimension; transient Astra outage.
Related errors
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/02dc43ed033fa466.
Report an issue: GitHub.