Random error on RAG retrieval using Supabase Vector Store

Describe the problem/error/question

Hello everyone, new user here!

I’m implementing an agentic RAG System using Supabase as vector store but randomically I get error with apparent no reason.
In fact if I try back some moments after using the same query it start working again.

What is also annoying me is that since in the Vector usage as tool there is no Error handling possibility it just blows up with no possibility to retry or implement any error flow that I think it should be done to have a robust architecture.

Any idea on why this is happening?

Please find the error I receive

Thank you!

What is the error message (if any)?

Error searching for documents: TypeError: fetch failed TypeError: fetch failed at node:internal/deps/undici/undici:14900:13 at processTicksAndRejections (node:internal/process/task_queues:105:5) at SupabaseVectorStore._searchSupabase (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_064ba5962b09c041feb4db2410e0e318/node_modules/@langchain/community/src/vectorstores/supabase.ts:307:39) at SupabaseVectorStore.similaritySearchVectorWithScore (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_064ba5962b09c041feb4db2410e0e318/node_modules/@langchain/community/src/vectorstores/supabase.ts:330:22) at handleRetrieveAsToolExecuteOperation (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_483a58943c290d26157214acd0d782a6/node_modules/@n8n/n8n-nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.ts:62:14) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_483a58943c290d26157214acd0d782a6/node_modules/@n8n/n8n-nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts:300:19) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:8) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1226:11) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1662:27 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2274:11

Setup

  • n8n version: 2
  • Database (default: SQLite): Supabase
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud
  • Operating system: -

This seems like a connection issue. Are you running n8n self-hosted or in the cloud?

N8N is run on cloud.

the strange thing is that is random, it can give me this error even more than once and than it disappears without doing anything.

Again, being an agent tool I have no control over the error management