{"record":{"id":"851e5fda65911984","repo":"FlowiseAI/Flowise","slug":"e-851e5f","errorCode":null,"errorMessage":"${e}","messagePattern":"\\$\\{e\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Redis/Redis.ts","lineNumber":201,"sourceCode":"                // Avoid Illegal invocation error\n                vectorStore.similaritySearchVectorWithScore = async (query: number[], k: number, filter?: any) => {\n                    return await similaritySearchVectorWithScore(\n                        query,\n                        k,\n                        indexName,\n                        metadataKey,\n                        vectorKey,\n                        contentKey,\n                        redisClient,\n                        filter\n                    )\n                }\n\n                await redisClient.quit()\n\n                return { numAdded: finalDocs.length, addedDocs: finalDocs }\n            } catch (e) {\n                throw new Error(e)\n            }\n        }\n    }\n\n    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const indexName = nodeData.inputs?.indexName as string\n        let contentKey = nodeData.inputs?.contentKey as string\n        let metadataKey = nodeData.inputs?.metadataKey as string\n        let vectorKey = nodeData.inputs?.vectorKey as string\n        const embeddings = nodeData.inputs?.embeddings as Embeddings\n        const topK = nodeData.inputs?.topK as string\n        const k = topK ? parseFloat(topK) : 4\n        const output = nodeData.outputs?.output as string\n\n        let redisUrl = getCredentialParam('redisUrl', credentialData, nodeData)\n        if (!redisUrl || redisUrl === '') {\n            const username = getCredentialParam('redisCacheUser', credentialData, nodeData)","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Redis/Redis.ts#L183-L219","documentation":"Redis vector store's `add` path catches any error from the Redis vectorstore ingestion pipeline (RedisVectorStore.fromDocuments / addDocuments, plus `redisClient.quit()`) and re-wraps it as `new Error(e)`. The underlying cause is typically Redis connectivity, missing RediSearch module, index schema mismatch, or a quit-time failure. The re-wrap discards the original stack.","triggerScenarios":"Redis connection refused/timeout; RediSearch module not loaded (FT.CREATE / FT.INFO unavailable); index name/schema mismatch; `contentKey`/`metadataKey`/`vectorKey` misconfigured; `redisClient.quit()` throwing after a prior pipeline error; vector dimension mismatch with the index.","commonSituations":"Pointing at a plain Redis (no RediSearch); wrong Redis URL/password; embedding model changed so vector dim no longer matches the existing index; index dropped out-of-band.","solutions":["Confirm the Redis instance is RediSearch-capable (Redis Stack) and reachable with the configured credentials.","Verify the index name and key names (contentKey/metadataKey/vectorKey) match the existing index schema.","Ensure the embedding dimension matches the index's vector field dimension.","Run `redis-cli FT.INFO <index>` directly to validate the index and module.","Differentiate the wrapped error by reproducing the underlying call in isolation."],"exampleFix":"// before\ncatch (e) { throw new Error(e) }\n\n// after\ncatch (e) { throw new Error(`Redis add failed: ${e instanceof Error ? e.message : String(e)}`, { cause: e }) }","handlingStrategy":"try-catch","validationCode":"async function assertRedisSearchReady(client: any, indexName: string) {\n  try { await client.ft.info(indexName) } catch (e: any) {\n    if (/unknown command/i.test(e?.message ?? '')) throw new Error('RediSearch module not loaded; use redis-stack')\n  }\n}","typeGuard":"null","tryCatchPattern":"try { await ingest() } catch (e) { throw new Error(`Redis ingest failed: ${e instanceof Error ? e.message : String(e)}`, { cause: e }) }","preventionTips":["Run a RediSearch-capable Redis (redis-stack).","Pre-flight FT.INFO to confirm the module and index.","Keep index vector dimension aligned with the embedding model.","Wrap redisClient.quit() so its error does not mask the real one."],"tags":["redis","redisearch","vectorstore","error-wrapping","network","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}