Skip to content
Error [ERROR: Canno...
 
Notifications
Clear all

Error [ERROR: Cannot read properties of undefined (reading 'filter')] with chat and AI agent

3 Posts
2 Users
0 Reactions
4 Views
marceltoma
(@marceltoma)
Posts: 2
New Member
Topic starter
 

I encountered an error when attempting to call the AI Agent node from the chat message node.

AI Agent Node Input

[
  {
    "sessionId": "test-dc14c161-6ae6-44be-b37f-50e9dfc6b7bd",
    "action": "sendMessage",
    "chatInput": "testing"
  }
]
{
  "errorMessage": "Cannot read properties of undefined (reading 'filter')",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.61.0 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "TypeError: Cannot read properties of undefined (reading 'filter')",
      "    at convertAMessagesToOllama (/usr/local/lib/node_modules/n8n/node_modules/@langchain/ollama/dist/utils.cjs:34:41)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/@langchain/ollama/dist/utils.cjs:138:20",
      "    at Array.flatMap (<anonymous>)",
      "    at convertToOllamaMessages (/usr/local/lib/node_modules/n8n/node_modules/@langchain/ollama/dist/utils.cjs:133:21)",
      "    at ChatOllama._streamResponseChunks (/usr/local/lib/node_modules/n8n/node_modules/@langchain/ollama/dist/chat_models.cjs:727:71)",
      "    at _streamResponseChunks.next (<anonymous>)",
      "    at ChatOllama._generate (/usr/local/lib/node_modules/n8n/node_modules/@langchain/ollama/dist/chat_models.cjs:686:26)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/language_models/chat_models.cjs:186:96",
      "    at Array.map (<anonymous>)",
      "    at ChatOllama._generateUncached (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/language_models/chat_models.cjs:186:67)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at LLMChain._call (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/llm_chain.cjs:162:37)",
      "    at LLMChain.invoke (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/base.cjs:58:28)",
      "    at LLMChain.predict (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/llm_chain.cjs:188:24)",
      "    at ChatConversationalAgent._plan (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/agents/agent.cjs:476:24)",
      "    at AgentExecutor._call (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/agents/executor.cjs:432:26)",
      "    at AgentExecutor.invoke (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/base.cjs:58:28)",
      "    at Object.conversationalAgentExecute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js:71:28)",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/Agent.node.js:349:20)",
      "    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 callin.io setup

  • callin.io version: 1.61.0
  • Database (default: SQLite): Postgres
  • callin.io EXECUTIONS_PROCESS setting (default: own, main):
  • Running callin.io via (Docker, npm, callin.io cloud, desktop app): Docker
  • Operating system: Windows 11

Could someone please assist with this issue?

 
Posted : 07/10/2024 4:43 pm
marceltoma
(@marceltoma)
Posts: 2
New Member
Topic starter
 

I've identified the problem; it was related to memory. When I disconnected the postgres node, it started working. I also tested by clearing all history with the postgres node still connected, and that also resolved the issue.

It appears that something in the data becomes corrupted after a certain number of queries, though the exact reason is unclear.

 
Posted : 07/10/2024 6:49 pm
system
(@system)
Posts: 332
Reputable Member
 

This discussion was automatically closed 7 days following the last response. New replies are no longer permitted.

 
Posted : 14/10/2024 6:50 pm
Share: