FlowiseAI/Flowise · error · Error

${e}

Error message

${e}

What it means

Generic catch-all in the Postgres node's add path wrapping batched or single `vectorStoreDriver.fromDocuments(...)` calls. Any PGVector/TypeORM failure (connection, table creation, dimension, duplicate) is re-thrown as `new Error(e)`, flattening the original error into a string.

Source

Thrown at packages/components/nodes/vectorstores/Postgres/Postgres.ts:293

                        }
                    })

                    return res
                } else {
                    if (_batchSize) {
                        const batchSize = parseInt(_batchSize, 10)
                        for (let i = 0; i < finalDocs.length; i += batchSize) {
                            const batch = finalDocs.slice(i, i + batchSize)
                            await vectorStoreDriver.fromDocuments(batch)
                        }
                    } else {
                        await vectorStoreDriver.fromDocuments(finalDocs)
                    }

                    return { numAdded: finalDocs.length, addedDocs: finalDocs }
                }
            } catch (e) {
                throw new Error(e)
            }
        },
        async delete(nodeData: INodeData, ids: string[], options: ICommonObject): Promise<void> {
            const vectorStoreDriver: VectorStoreDriver = Postgres_VectorStores.getDriverFromConfig(nodeData, options)
            const tableName = getTableName(nodeData)
            const recordManager = nodeData.inputs?.recordManager

            const vectorStore = await vectorStoreDriver.instanciate()

            try {
                if (recordManager) {
                    const vectorStoreName = tableName
                    await recordManager.createSchema()
                    ;(recordManager as any).namespace = (recordManager as any).namespace + '_' + vectorStoreName
                    const filterKeys: ICommonObject = {}
                    if (options.docId) {
                        filterKeys.docId = options.docId
                    }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Read the flattened message for the driver-specific reason (connection, extension, dimension).
  2. Verify Postgres connectivity and credentials.
  3. Ensure `CREATE EXTENSION IF NOT EXISTS vector;` has been run and the user can use it.
  4. Confirm the table's vector column dimension matches the embedding model.
  5. Re-wrap preserving the original error (see fix).

Example fix

// before
} catch (e) {
    throw new Error(e)
}
// after — preserve cause
} catch (e) {
    throw e instanceof Error ? e : new Error(String(e))
}
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: connectivity + pgvector extension + dimension
const pool = new Pool({ connectionString })
const ext = await pool.query("SELECT 1 FROM pg_extension WHERE extname='vector'")
if (!ext.rowCount) throw new Error('pgvector extension not installed')
const dim = (await embeddings.embedQuery('test')).length
if (tableVectorDim && dim !== tableVectorDim) throw new Error(`dim ${dim} != column ${tableVectorDim}`)
await pool.end()

Type guard

function isPgConnectionError(e: unknown): boolean {
  const msg = e instanceof Error ? e.message : String(e)
  return /ECONNREFUSED|password authentication|no pg_hba/i.test(msg)
}

Try / catch

try {
  for (let i = 0; i < finalDocs.length; i += batchSize) {
    await vectorStoreDriver.fromDocuments(finalDocs.slice(i, i + batchSize))
  }
} catch (e) {
  throw e instanceof Error ? e : new Error(`Postgres fromDocuments failed: ${String(e)}`)
}

Prevention

When it happens

Trigger: Postgres unreachable; auth failure; `pgvector` extension not installed; table creation permission denied; vector dimension mismatch with the column type; TypeORM/PGVector driver-specific error; batch size parse error.

Common situations: Connection string points at wrong host/port; `pgvector` extension not enabled on the DB; user lacks CREATE TABLE; embedding model changed dimension without migrating the column; `additionalConfig` JSON malformed.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/41659d9d3d84798c. Report an issue: GitHub.