"Document Loader is not initialized" n8n error

Describe the problem/error/question

I’m setting up a workflow for RAG, from PDF, TXT’s and Sheets primarily, using Supabase. The error comes at the end of the workflow, when the document vector should be uploaded to Supabase, the error says “Document loader is not initialized”

What is the error message (if any)?

Message is; “Document loader is not initialized”

Node type

@n8n/n8n-nodes-langchain.documentDefaultDataLoader

Node version

1 (Latest)

n8n version

1.63.4 (Self Hosted)

Time

10/24/2024, 5:09:44 PM

Stack trace

NodeOperationError: Document loader is not initialized at N8nJsonLoader.processItem (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/N8nJsonLoader.js:49:19) at N8nJsonLoader.callMethodAsync (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:24:40) at Proxy.connectionType (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:257:65) at processDocument (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/shared/processDocuments.js:26:50) at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/shared/createVectorStoreNode.js:200:114) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:722:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:711:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1141:20

Please share your workflow

Share the output returned by the last node

NodeOperationError: Document loader is not initialized at N8nJsonLoader.processItem (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/N8nJsonLoader.js:49:19) at N8nJsonLoader.callMethodAsync (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:24:40) at Proxy.connectionType (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:257:65) at processDocument (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/shared/processDocuments.js:26:50) at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/shared/createVectorStoreNode.js:200:114) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:722:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:711:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1141:20

Information on your n8n setup

  • n8n version: 1.63.4
  • Database: PostgresSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Own? not sure what’s asked here
  • Running n8n via Docker
  • Operating system: Win 11 Home - Build 22631.4317

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hi @andresopeth

Thanks for posting here and welcome to the community! :cupcake:

It could be that the value passed in to the document loader is not a proper format (it’s checking for objects or strings, but if it is neither (e.g., null or undefined), it’s not going to be able to infer what kind of document loader to add)

Can you share an example of what kind of data is being received from your workflow here that gives you that error:

Hi im i have the same setup - its from this youtube video basically https://www.youtube.com/watch?v=T1ZKEmDN8AA&t=970s

Oddly it was working, but now it isnt and im not sure if its because of 1.65 update or not. Im getting the same error - the data im uploading is a PDF School Handbook. which worked before but now that information has disappeared from superbase and when i try to run it i get the same issue, sometimes it doesnt even tell me the error it acts like it was successful but nothing happened even the superbase nodes arent lit up green.

Hi @Maki99

Thanks for reporting this. I was able to reproduce this error.
Will escalate with our engineers and update here.

I fixed this issue temporarily by giving each output its own superbase node… but thats not ideal like the first setup. thanks for looking into it.

Hey, Im just learning to code. So I really cant explain how. But I made it work with a loop in the download file from drive. Before the switch. You could get an idea form Nate’s video: