Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text classifier throws an exception #12370

Open
bratorange opened this issue Dec 25, 2024 · 2 comments
Open

Text classifier throws an exception #12370

bratorange opened this issue Dec 25, 2024 · 2 comments
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@bratorange
Copy link

Bug Description

The classifier node would fail to output results and only show an error: Cannot read properties of undefined (reading 'additional_kwargs')

Relevant Process logs:
Cannot read properties of undefined (reading 'additional_kwargs')
Dec 26 00:01:46 Host n8n[37311]: TypeError: Cannot read properties of undefined (reading 'additional_kwargs')
Dec 26 00:01:46 Host n8n[37311]: at new BaseMessage (/nix/store/a6z8mqa9ly4yy0i06ps4p96mzilf9drg-n8n-1.70.1/lib/n8n/node_modules/.pnpm/@langchain[email protected]_>
Dec 26 00:01:46 Host n8n[37311]: at new HumanMessage (/nix/store/a6z8mqa9ly4yy0i06ps4p96mzilf9drg-n8n-1.70.1/lib/n8n/node_modules/.pnpm/@langchain[email protected]>
Dec 26 00:01:46 Host n8n[37311]: at ExecuteContext.execute (/nix/store/a6z8mqa9ly4yy0i06ps4p96mzilf9drg-n8n-1.70.1/lib/n8n/packages/@n8n/nodes-langchain/nodes>
Dec 26 00:01:46 Host n8n[37311]: at processTicksAndRejections (node:internal/process/task_queues:95:5)
Dec 26 00:01:46 Host n8n[37311]: at Workflow.runNode (/nix/store/a6z8mqa9ly4yy0i06ps4p96mzilf9drg-n8n-1.70.1/lib/n8n/packages/workflow/src/Workflow.ts:1383:8)
Dec 26 00:01:46 Host n8n[37311]: at /nix/store/a6z8mqa9ly4yy0i06ps4p96mzilf9drg-n8n-1.70.1/lib/n8n/packages/core/src/WorkflowExecute.ts:1162:27
Dec 26 00:01:46 Host n8n[37311]: at /nix/store/a6z8mqa9ly4yy0i06ps4p96mzilf9drg-n8n-1.70.1/lib/n8n/packages/core/src/WorkflowExecute.ts:1883:11

To Reproduce

Use workflow and setup an url in the "Http request" node for some csv test file.

{
"nodes": [
{
"parameters": {
"url": "Redacted",
"options": {
"response": {
"response": {
"responseFormat": "file"
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-80,
40
],
"id": "1f03dcef-7d21-4093-8eee-6927b0613e89",
"name": "HTTP Request"
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-300,
40
],
"id": "240d1039-7d1c-4014-8db5-a5308de3a755",
"name": "When clicking ‘Test workflow’"
},
{
"parameters": {
"fileFormat": "csv",
"options": {
"delimiter": ";"
}
},
"id": "46a33e99-bff0-47c1-865c-0c26c89d3957",
"name": "Import CSV",
"type": "n8n-nodes-base.spreadsheetFile",
"position": [
160,
40
],
"typeVersion": 2
},
{
"parameters": {
"inputText": "={{ $json.replaceMe}}",
"categories": {
"categories": [
{
"category": "Essen"
},
{
"category": "Miete"
},
{
"category": "Einkommen"
}
]
},
"options": {
"fallback": "discard"
}
},
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"typeVersion": 1,
"position": [
640,
-40
],
"id": "ff61e398-2b96-472b-a5d2-98d13556b750",
"name": "Text Classifier"
},
{
"parameters": {
"model": "llama3-groq-8b-8192-tool-use-preview",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"typeVersion": 1,
"position": [
780,
320
],
"id": "ba210d05-2b8b-4a5d-95e2-d19d3a51a353",
"name": "Groq Chat Model",
"credentials": {
"groqApi": {
"id": "Redacted",
"name": "Groq account"
}
}
},
{
"parameters": {
"fieldsToAggregate": {
"fieldToAggregate": [
{}
]
},
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
1120,
0
],
"id": "6108f66c-2f12-4044-84d9-8a43b39a99f4",
"name": "Aggregate"
}
],
"connections": {
"HTTP Request": {
"main": [
[
{
"node": "Import CSV",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Import CSV": {
"main": [
[
{
"node": "Text Classifier",
"type": "main",
"index": 0
}
]
]
},
"Text Classifier": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[]
]
},
"Groq Chat Model": {
"ai_languageModel": [
[
{
"node": "Text Classifier",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"pinData": {}
}

Expected behavior

I expect the classifier node to output data to the next node.

Operating System

Nixos-unstable

n8n Version

1.70.1

Node.js Version

23.2.0

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Dec 25, 2024

Hey @bratorange,

We have created an internal ticket to look into this which we will be tracking as "N8N-8011"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Dec 25, 2024
@bratorange
Copy link
Author

I have had another look and some parts of the input data seem to be undefined aswell:
Screenshot 2024-12-26 at 01 30 09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants