{"record":{"id":"e57f4a4e3f607c34","repo":"FlowiseAI/Flowise","slug":"e-e57f4a","errorCode":null,"errorMessage":"${e}","messagePattern":"\\$\\{e\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Singlestore/Singlestore.ts","lineNumber":155,"sourceCode":"            } as SingleStoreVectorStoreConfig\n\n            const docs = nodeData.inputs?.document as Document[]\n            const embeddings = nodeData.inputs?.embeddings as Embeddings\n\n            const flattenDocs = docs && docs.length ? flatten(docs) : []\n            const finalDocs = []\n            for (let i = 0; i < flattenDocs.length; i += 1) {\n                if (flattenDocs[i] && flattenDocs[i].pageContent) {\n                    finalDocs.push(new Document(flattenDocs[i]))\n                }\n            }\n\n            try {\n                const vectorStore = new SingleStoreVectorStore(embeddings, singleStoreConnectionConfig)\n                vectorStore.addDocuments.bind(vectorStore)(finalDocs)\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 user = getCredentialParam('user', credentialData, nodeData)\n        const password = getCredentialParam('password', credentialData, nodeData)\n\n        const singleStoreConnectionConfig = {\n            connectionOptions: {\n                host: nodeData.inputs?.host as string,\n                port: 3306,\n                user,\n                password,\n                database: nodeData.inputs?.database as string\n            },\n            ...(nodeData.inputs?.tableName ? { tableName: nodeData.inputs.tableName as string } : {}),","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Singlestore/Singlestore.ts#L137-L173","documentation":"SingleStore's `add` path constructs a `SingleStoreVectorStore` and calls `vectorStore.addDocuments.bind(vectorStore)(finalDocs)` inside a try/catch that re-wraps the result as `new Error(e)`. Note the bound call's returned Promise is not awaited, so asynchronous failures from `addDocuments` may escape this catch entirely; the catch mainly guards synchronous construction errors. Real failures usually come from SingleStore connectivity/SQL.","triggerScenarios":"SingleStore host/port unreachable; wrong user/password (credential); database/table not present or wrong schema; vector column type mismatch; the un-awaited `addDocuments` promise rejecting asynchronously (not caught here).","commonSituations":"SingleStore connection options misconfigured (host, port, database); credentials rotated; table missing the embedding column; network/firewall blocking the SingleStore port.","solutions":["Verify `host`, credentials (`user`/`password`), and database name resolve and authenticate.","Ensure the target table exists with a compatible vector/embedding column.","Await the addDocuments call so async errors are actually caught: `await vectorStore.addDocuments(finalDocs)`.","Test the connection in isolation with a simple SELECT before ingestion."],"exampleFix":"// before\nvectorStore.addDocuments.bind(vectorStore)(finalDocs)  // not awaited\ncatch (e) { throw new Error(e) }\n\n// after\nawait vectorStore.addDocuments(finalDocs)\ncatch (e) { throw new Error(`SingleStore addDocuments failed: ${e instanceof Error ? e.message : String(e)}`, { cause: e }) }","handlingStrategy":"try-catch","validationCode":"function validateSingleStoreInputs(inputs: any, creds: any) {\n  if (!inputs?.host) throw new Error('host is required')\n  if (!creds?.user || !creds?.password) throw new Error('singlestore user/password required')\n}","typeGuard":"null","tryCatchPattern":"try { await vectorStore.addDocuments(finalDocs) }  // MUST await\ncatch (e) { throw new Error(`SingleStore ingest failed: ${e instanceof Error ? e.message : String(e)}`, { cause: e }) }","preventionTips":["Await addDocuments so async errors are caught.","Validate connection options before constructing the store.","Confirm the target table and vector column exist.","Test connectivity with a simple SELECT first."],"tags":["singlestore","vectorstore","error-wrapping","async","network","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}