FlowiseAI/Flowise · error · Error
Error inserting: ${res.error.message} ${res.status} ${res.st
Error message
Error inserting: ${res.error.message} ${res.status} ${res.statusText} What it means
In `SupabaseUpsertVectorStore.addVectors`, after the first upsert fails with a `null value in column "id"` error, the code regenerates ids (using provided ids or uuidv4) and retries the upsert in batches. This error is thrown when that retry ALSO fails, meaning the failure is not merely a missing id but a deeper schema/policy/dimension problem. The message concatenates the Supabase error message, HTTP status, and status text.
Source
Thrown at packages/components/nodes/vectorstores/Supabase/Supabase.ts:286
}
return row
})
let res = await this.client.from(this.tableName).upsert(chunk).select()
if (res.error) {
// If the error is due to null value in column "id", we will generate a new id for the row
if (res.error.message.includes(`null value in column "id"`)) {
const chunk = rows.slice(i, i + this.upsertBatchSize).map((row, y) => {
if (options?.ids) {
return { id: options.ids[i + y], ...row }
}
return { id: uuidv4(), ...row }
})
res = await this.client.from(this.tableName).upsert(chunk).select()
if (res.error) {
throw new Error(`Error inserting: ${res.error.message} ${res.status} ${res.statusText}`)
}
} else {
throw new Error(`Error inserting: ${res.error.message} ${res.status} ${res.statusText}`)
}
}
if (res.data) {
returnedIds = returnedIds.concat(res.data.map((row) => row.id))
}
}
return returnedIds
}
}
module.exports = { nodeClass: Supabase_VectorStores }
View on GitHub (pinned to abe4a8601a)
Solutions
- Use the service role key to bypass RLS during ingestion.
- Align the embedding dimension with the table's `vector(N)` column.
- Inspect `res.error.message`/`res.status` in the wrapped text to identify the constraint/policy.
- Add defaults or supply values for any other NOT NULL columns; ensure no unique-constraint collisions on retry.
Example fix
// before
res = await this.client.from(this.tableName).upsert(chunk).select()
if (res.error) throw new Error(`Error inserting: ${res.error.message} ${res.status} ${res.statusText}`)
// after (structured error)
res = await this.client.from(this.tableName).upsert(chunk).select()
if (res.error) {
const err = new Error(`Supabase upsert failed: ${res.error.message} (${res.status} ${res.statusText})`)
;(err as any).status = res.status; (err as any).code = res.error.code
throw err
} Defensive patterns
Strategy: validation
Validate before calling
function assertSupabaseUpsertReady(client: any, tableName: string, embeddingDim: number) {
// before bulk upsert, verify table + vector dim + RLS bypass
if (!tableName) throw new Error('tableName required')
if (!Number.isFinite(embeddingDim) || embeddingDim <= 0) throw new Error('embedding dim must be positive')
} Type guard
null
Try / catch
res = await this.client.from(this.tableName).upsert(chunk).select()
if (res.error) { const e = new Error(`Supabase upsert retry failed: ${res.error.message} (${res.status})`); (e as any).status = res.status; throw e } Prevention
- Use the service role key so RLS does not block the retry.
- Keep embedding dim == vector(N) column.
- Supply ids explicitly to avoid the null-id retry path.
- Surface res.error.code/status for diagnosis.
When it happens
Trigger: RLS policy denying insert even with an id; vector/embedding column type or dimension mismatch; NOT NULL constraint on another column; unique constraint violation on retry; the table schema changed after the null-id fix path was taken.
Common situations: Service role not used so RLS blocks the retry; embedding model swapped (dimension mismatch vs the `vector(N)` column); a required metadata column added without default; concurrent upserts hitting a unique constraint.
Related errors
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/6ff51540768e732e.
Report an issue: GitHub.