{"record":{"id":"57722017f7b080e3","repo":"n8n-io/n8n","slug":"error-error-message-577220","errorCode":null,"errorMessage":"Error: ${error.message}","messagePattern":"Error: (.+?)","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.ts","lineNumber":407,"sourceCode":"\t\t\tconst embeddingField = getEmbeddingKey(context, itemIndex).trim();\n\t\t\tconst ttl = getTtl(context, itemIndex);\n\n\t\t\tif (overwrite) {\n\t\t\t\tawait client.ft.dropIndex(indexField, { DD: true });\n\t\t\t}\n\n\t\t\tawait ExtendedRedisVectorSearch.fromDocuments(documents, embeddings, {\n\t\t\t\tredisClient: client,\n\t\t\t\tindexName: indexField,\n\t\t\t\t...(keyPrefixField ? { keyPrefix: keyPrefixField } : {}),\n\t\t\t\t...(metadataField ? { metadataKey: metadataField } : {}),\n\t\t\t\t...(contentField ? { contentKey: contentField } : {}),\n\t\t\t\t...(embeddingField ? { vectorKey: embeddingField } : {}),\n\t\t\t\t...(ttl ? { ttl } : {}),\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tcontext.logger.info(`Error while populating the store: ${error.message}`);\n\t\t\tthrow new NodeOperationError(context.getNode(), `Error: ${error.message}`, {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check your index/schema and parameters',\n\t\t\t});\n\t\t}\n\t},\n}) {}\n","sourceCodeStart":389,"sourceCodeEnd":414,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.ts#L389-L414","documentation":"A catch-all wrapper in populateVectorStore around ExtendedRedisVectorSearch.fromDocuments. Any error raised while inserting documents into Redis is logged at info level and re-thrown as a NodeOperationError echoing the original message. The original cause is in error.message and the log line.","triggerScenarios":"fromDocuments fails during populate — e.g. embedding vector dimension does not match the index SCHEMA VECTOR field dimension; key prefix/metadata/content/vector key options conflict with the index schema; TTL invalid; Redis write rejected (OOM, wrong type, permission); RediSearch schema mismatch.","commonSituations":"Switched embedding model so vector dimensions changed but the index was not rebuilt; index created with a different SCHEMA than the current keyPrefix/metadataKey/contentKey/vectorKey options; TTL set on a Redis version/config that disallows it; oversized payload or Redis maxmemory eviction.","solutions":["Read the full underlying error in the node output / n8n logs (the wrapped error.message) — it names the real cause (dimension mismatch, wrong type, etc.).","If it is a dimension mismatch, drop and recreate the index with a VECTOR field matching the new embedding dimension, then re-run Insert.","Align the node's keyPrefix/metadataKey/contentKey/vectorKey options with the FT.CREATE SCHEMA fields.","Validate TTL is a positive integer supported by your Redis; remove it if unsupported.","Check Redis INFO memory and slowlog if the failure looks resource-related."],"exampleFix":"// before: index SCHEMA VECTOR field HNSW DIMENSION 1536, new embeddings are 3072-dim\n// after:  drop & recreate:\n//   FT.DROPINDEX myindex\n//   FT.CREATE myindex ON HASH PREFIX 1 doc: SCHEMA content TEXT vector VECTOR HNSW DIMENSION 3072 DISTANCE_METRIC COSINE","handlingStrategy":"try-catch","validationCode":"// validate dimensions + schema keys match the index before populating\nfunction assertSchemaCompat(opts: { metadataKey: string; contentKey: string; vectorKey: string }, dim: number, indexDim: number) {\n  if (dim !== indexDim) throw new Error(`embedding dim ${dim} != index VECTOR dim ${indexDim}`);\n  for (const k of Object.values(opts)) if (!k) throw new Error(`Empty schema key: ${JSON.stringify(opts)}`);\n}","typeGuard":"function isPositiveTtl(ttl: unknown): ttl is number { return typeof ttl === 'number' && ttl > 0 && Number.isFinite(ttl); }","tryCatchPattern":"try { await store.populateVectorStore(...) } catch (e) { logOriginal(e); throw new Error(`Populate failed: ${e.message}`); }","preventionTips":["Keep embedding model and index VECTOR dimension in lockstep; rebuild the index when the model changes.","Treat keyPrefix/metadataKey/contentKey/vectorKey as part of the index schema contract.","Preserve the original error (message + stack) when rethrowing so root cause survives.","Log at error, not info, for populate failures to aid diagnosis."],"tags":["redis","vector-store","embeddings","schema","dimension-mismatch"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}