ERROR: Cannot read properties of undefined (reading 'name')

The error I’m receiving ERROR: Cannot read properties of undefined (reading 'name')

When I’m executing the node manually everything works fine. When I execute the whole workflow manually, it throws the error.

Any idea how to fix this?

What ‘name’ is it trying to read?

Hi @donniedarkowindsalt :wave: Could you share your entire workflow with us, as well as this information:

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

from the partial stack that’s visible in the screenshot, I’m guessing the issue is on this line.

But, to be able to even try to fix this (in general any issue like this), we need

  1. The full stack as text from the bottom right panel.
  2. a sample workflow to reproduce this.

I had the same error, when the workflow was triggering a workflow created under another user account on the same community instance.
Recreating the referenced workflow under the same account as the other parts solved the problem.

version: 0.222.3

Hi,

Had the same problem just now, using an IF node to process the output of an XML to JSON node. Got exactly the same error. Think it’s a n8n bug. Admittedly, this is an older version of n8n, so maybe this has been fixed by now.

I solved it by putting a SET node in-between, and then had the IF node process the output from the SET node, which worked.

Kind regards,

Jos

I had this error, I had originally had the workflow triggering another workflow or vice versa, I ended up deleting that node, then when I went to activate it, I got this error.

I ended up downloading the workflow, creating a new workflow from scratch and importing from file.

I was able to activate the new workflow without issue. I don’t know if duplicating it would work, but this was the fix that vexed me all morning

Its a bit of a recurring problem but when it pops up, i duplicate the trigger node, delete the original and connect the duplicate node and then activate, seems to work

This error keeps recurring at random for multiple users, and not fixed till this day

1 Like

I’m currenlty having the same issue each time i call another workflow in the initial one
copy pasting the called workflow in the middle of the original one instead of calling it works, but when it comes to bigger workflows to call it’s a bit messy to paste it in my original one
@Jos_van_Uden where exactly did you put your SET node ? (i already have one before and after calling the additional workflow and it doesn’t work…)
@Support_Team

Hi, I have this error that started occurring a few weeks or so back with a Pushcut send notification node reliably in one workflow, but not another.

Here’s my info, in case it’s useful and indeed the same as the others in this thread:

  • n8n version:: 1.31.2 (though it’s been happening for a few recent versions)
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default/env var not set
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker (compose)
  • Operating system: Ubuntu 22.04.4 LTS (GNU/Linux 6.5.0-1014-aws aarch64)

Error & Stack trace:

ERROR: Cannot read properties of undefined (reading ‘name’)

Cause:

{"devices":["my_pushover_device_name_redacted"],"input":"={{ $('Redis: Get key_redacted).item.json.item_redacted }}"}

Stack:

TypeError: Cannot read properties of undefined (reading 'name')
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1371:96
    at Array.forEach (<anonymous>)
    at cleanupParameterData (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1368:32)
    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1522:9)
    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2190:24)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Pushcut/Pushcut.node.js:162:51)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:730:42)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:660:68
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1062:20

The node code in question, with some redactions:

2 Likes

Thanks a lot @craSH for sharing the stacktrace. That’s all that we needed to fix this :pray:.

Here is a PR that addresses this.
It’ll likely be released in 1.34.0 on Wednesday.

2 Likes

Now that’s what I call service! :slight_smile: Thanks for the speedy action.

Looking forward to confirming the fix once this lands!

1 Like

New version [email protected] got released which includes the GitHub PR 8910.

1 Like

@jan I can confirm this has fixed the issue for me on 1.34.0 with a real-world event/workflow execution! Thank you.

1 Like

Hey all :wave:

I’m getting this error on a lot of my workflows using webhook nodes as startup point.
This issue is raised on our main & webhook pod in our k8s

`2024-04-11T15:30:17.783Z | error    | Error: Cannot read properties of undefined (reading 'node') "{ file: 'LoggerProxy.js', function: 'exports.error' }"`
`2024-04-11T15:30:17.786Z | error    | Problem with execution 7467343: Cannot read properties of undefined (reading 'node'). Aborting. "{ file: 'WorkflowRunner.js' }"`
`2024-04-11T15:30:17.786Z | error    | Error: Cannot read properties of undefined (reading 'node') "{ file: 'LoggerProxy.js', function: 'exports.error' }"`

That seems to be linked to another issue related to running workflows.
I have no idea when this started so I won’t be able to tell you which version could be the origin.

As usual, here is my setup:

  • n8n version: 1.36.1
  • Database (default: SQLite): Postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): k8s on Internal cloud
  • Operating system: Alpine Linux

Let me know if I can test anything to help in the investigation.

Cannot read properties of undefined is a generic error, and it’s likely that this is caused by some other part of the code.
To be able to fix this we’d need the full stack-trace. If you want, I can send you a Sentry key, that you can set on your deployment, and when this error happens next, we’ll have the stack trace and we can then easily fix this.
Let me know if you are willing (and have access) to set an additional env variable on your n8n deployment. I can send the key over in a direct message.

Hey @netroy,

Yes, I’m quite flexible with our setup so I can update our config if needed.

Hey @netroy,

I have rollback to 1.35.0 and the issue is now gone.

Hi @netroy,

Here is the full stack trace from our sentry:

Error: Cannot read properties of undefined (reading 'node')
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/bull/lib/job.js", line 516, col 18, in Queue.onFailed
  File "node:events", line 529, col 35, in Queue.emit
  File "node:domain", line 489, col 12, in Queue.emit
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/bull/lib/utils.js", line 50, col 20, in Object.module.exports.emitSafe
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/bull/lib/queue.js", line 476, col 15, in EventEmitter.messageHandler
  File "node:events", line 517, col 28, in EventEmitter.emit
  File "node:domain", line 489, col 12, in EventEmitter.emit
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/ioredis/built/DataHandler.js", line 80, col 32, in DataHandler.handleSubscriberReply
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/ioredis/built/DataHandler.js", line 47, col 18, in DataHandler.returnReply
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/ioredis/built/DataHandler.js", line 21, col 22, in JavascriptRedisParser.returnReply
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/redis-parser/lib/parser.js", line 544, col 14, in JavascriptRedisParser.execute
  File "app:///../../usr/local/lib/node_modules/n8n/node_modules/ioredis/built/DataHandler.js", line 25, col 20, in Socket.<anonymous>
  File "node:events", line 517, col 28, in Socket.emit
  File "node:domain", line 489, col 12, in Socket.emit
  File "node:internal/streams/readable", line 368, col 12, in addChunk
  File "node:internal/streams/readable", line 341, col 9, in readableAddChunk
  File "node:internal/streams/readable", line 278, col 10, in Socket.Readable.push
  File "node:internal/stream_base_commons", line 190, col 23, in TCP.onStreamRead
  File "node:internal/async_hooks", line 128, col 17, in TCP.callbackTrampoline

For your information, by looking at the full stack trace, we’ve guessed that the issue could be coming from Redis.

So we were using 7.0.4 and upgrading to 7.0.15 didn’t changed anything.
Note that it was hosted in a pod into our k8s setup.

By moving our Redis into a dedicated server with the 7.2.4 seems to have finally fixed our issue. :partying_face: