{"record":{"id":"69a05e9699b89d65","repo":"FlowiseAI/Flowise","slug":"e-69a05e","errorCode":null,"errorMessage":"${e}","messagePattern":"\\$\\{e\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Couchbase/Couchbase.ts","lineNumber":176,"sourceCode":"\n            const couchbaseConfig: CouchbaseSearchVectorStoreArgs = {\n                cluster: couchbaseClient,\n                bucketName: bucketName,\n                scopeName: scopeName,\n                collectionName: collectionName,\n                indexName: indexName,\n                textKey: textKey,\n                embeddingKey: embeddingKey\n            }\n\n            try {\n                if (!textKey || textKey === '') couchbaseConfig.textKey = 'text'\n                if (!embeddingKey || embeddingKey === '') couchbaseConfig.embeddingKey = 'embedding'\n\n                await CouchbaseSearchVectorStore.fromDocuments(finalDocs, embeddings, couchbaseConfig)\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 bucketName = nodeData.inputs?.bucketName as string\n        const scopeName = nodeData.inputs?.scopeName as string\n        const collectionName = nodeData.inputs?.collectionName as string\n        const indexName = nodeData.inputs?.indexName as string\n        let textKey = nodeData.inputs?.textKey as string\n        let embeddingKey = nodeData.inputs?.embeddingKey as string\n        const embeddings = nodeData.inputs?.embeddings as Embeddings\n        const couchbaseMetadataFilter = nodeData.inputs?.couchbaseMetadataFilter\n\n        let connectionString = getCredentialParam('connectionString', credentialData, nodeData)\n        let databaseUsername = getCredentialParam('username', credentialData, nodeData)\n        let databasePassword = getCredentialParam('password', credentialData, nodeData)","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Couchbase/Couchbase.ts#L158-L194","documentation":"Generic catch-all around CouchbaseSearchVectorStore.fromDocuments during the upsert path. Wraps connection errors, bucket/scope/collection mismatches, indexing errors, and embedding failures into a string Error.","triggerScenarios":"Called from the Couchbase node's create/upsert when finalDocs and embeddings are pushed into a configured bucket/scope/collection. Fails on auth errors, missing bucket/scope/collection, missing vector index, or embedding service errors.","commonSituations":"Wrong connection string or credentials, bucket/scoped collection names typo'd, the Couchbase vector search index (indexName) not provisioned, or textKey/embeddingKey not matching the index mapping.","solutions":["Verify cluster connectivity and credentials with a raw couchbase SDK connection test.","Confirm bucket, scope, and collection names exist and the service account has access.","Ensure the vector index (indexName) is created and its mapping matches textKey/embeddingKey.","Replace `throw new Error(e)` with `throw e` to preserve the SDK's structured error."],"exampleFix":"// before\n} catch (e) {\n    throw new Error(e)\n}\n\n// after\n} catch (e) {\n    console.error('Couchbase fromDocuments failed', e)\n    throw e\n}","handlingStrategy":"try-catch","validationCode":"// confirm connectivity + index before upsert\nconst cluster = await couchbase.connect(connStr, { username, password })\nconst bucket = cluster.bucket(bucketName)\nawait bucket.defaultCollections() // throws if bucket missing\n// verify the collection + search index exist\nawait cluster.searchIndexes().getAllIndexNames() // ensure indexName present","typeGuard":"function isCouchbaseConfig(v: unknown): boolean {\n  return typeof v === 'object' && v !== null\n    && typeof (v as any).bucketName === 'string'\n    && typeof (v as any).scopeName === 'string'\n    && typeof (v as any).collectionName === 'string'\n}","tryCatchPattern":"try {\n  await CouchbaseSearchVectorStore.fromDocuments(finalDocs, embeddings, cfg)\n} catch (e) {\n  throw new Error(`Couchbase upsert failed (bucket=${cfg.bucketName}, scope=${cfg.scopeName}, coll=${cfg.collectionName}): ${e instanceof Error ? e.message : e}`)\n}","preventionTips":["Provision the vector search index before first upsert.","Confirm textKey/embeddingKey match the index mapping.","Health-check the cluster connection before bulk operations."],"tags":["couchbase","vector-store","error-wrapping","network"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}