{"record":{"id":"770dd10dc0c51052","repo":"n8n-io/n8n","slug":"table-tablename-not-found","errorCode":null,"errorMessage":"Table ${tableName} not found","messagePattern":"Table (.+?) not found","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.ts","lineNumber":102,"sourceCode":"\tasync populateVectorStore(context, embeddings, documents, itemIndex) {\n\t\tconst tableName = context.getNodeParameter('tableName', itemIndex, '', {\n\t\t\textractValue: true,\n\t\t}) as string;\n\t\tconst options = context.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tqueryName: string;\n\t\t};\n\t\tconst credentials = await context.getCredentials('supabaseApi');\n\t\tconst client = createClient(credentials.host as string, credentials.serviceRole as string);\n\n\t\ttry {\n\t\t\tawait SupabaseVectorStore.fromDocuments(documents, embeddings, {\n\t\t\t\tclient,\n\t\t\t\ttableName,\n\t\t\t\tqueryName: options.queryName ?? 'match_documents',\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif ((error as Error).message === 'Error inserting: undefined 404 Not Found') {\n\t\t\t\tthrow new NodeOperationError(context.getNode(), `Table ${tableName} not found`, {\n\t\t\t\t\titemIndex,\n\t\t\t\t\tdescription: 'Please check that the table exists in your vector store',\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthrow new NodeOperationError(context.getNode(), error as Error, {\n\t\t\t\t\titemIndex,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n}) {}\n","sourceCodeStart":84,"sourceCodeEnd":114,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.ts#L84-L114","documentation":"Thrown by the Supabase vector store populate path when SupabaseVectorStore.fromDocuments rejects with the exact message 'Error inserting: undefined 404 Not Found'. n8n string-matches that message to detect a missing table; any other rejection is rethrown as a generic NodeOperationError.","triggerScenarios":"populateVectorStore with a tableName that does not exist (or is not visible) in the Supabase project, so the PostgREST insert returns 404 and the langchain client surfaces the canned 'Error inserting: undefined 404 Not Found' text.","commonSituations":"The pgvector setup SQL (table + match_documents function) was never run in the target Supabase project; tableName typo; pointing at the wrong Supabase project/host; the table exists in a different schema; RLS blocks anonymous/service-role access so PostgREST reports 404.","solutions":["Run the Supabase pgvector setup SQL in the target project to create the table and the match_documents (or configured queryName) function.","Confirm the node's tableName matches the created table exactly.","Verify the serviceRole key and host point at the same Supabase project where the table was created.","If RLS is on, ensure the service-role key bypasses RLS or that a policy permits inserts.","Note: the matcher is brittle — if Supabase changes the error wording this branch is skipped and you get the generic rethrow; rely on the table existing, not on this message."],"exampleFix":"// before: tableName = 'docuements' (typo) -> 404\n// after:  tableName = 'documents' and ensure the table exists:\n//   create table documents (id uuid primary key, content text, metadata jsonb, embedding vector(1536));","handlingStrategy":"validation","validationCode":"// verify the table is reachable via PostgREST before populating\nconst res = await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', {\n  method: 'GET', uri: `${credentials.host}/rest/v1/${tableName}?limit=0`, json: true,\n});\n// a 404 here means the table is missing — create it before fromDocuments.","typeGuard":"function isTableName(name: unknown): name is string { return typeof name === 'string' && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name); }","tryCatchPattern":"try { await SupabaseVectorStore.fromDocuments(...) } catch (e) { if (/404 Not Found/.test(e.message)) await ensureSupabaseTable(); else throw e; }","preventionTips":["Run the pgvector setup SQL in every Supabase project as part of provisioning.","Do not rely on the exact '404 Not Found' string — validate table existence explicitly.","Keep tableName in a shared variable used by both setup and runtime.","Confirm serviceRole key + host point at the same project where the table was created."],"tags":["supabase","vector-store","pgvector","config","table"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}