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

"Cannot read properties of undefined" in no operation node #13086

Open
Fank opened this issue Feb 6, 2025 · 29 comments · Fixed by #13362 · May be fixed by #13840
Open

"Cannot read properties of undefined" in no operation node #13086

Fank opened this issue Feb 6, 2025 · 29 comments · Fixed by #13362 · May be fixed by #13840
Labels
in linear Issue or PR has been created in Linear for internal review Needs Feedback Waiting for further input or clarification.

Comments

@Fank
Copy link

Fank commented Feb 6, 2025

Bug Description

When calling a workflow i see items in between each node, but then suddenly it stops and i get following error:

Image

The filter node before the noop node has no undefined fields in its conditions:

Image

Image

NodeViewSwitcher-CUwv0PGz.js:14311 Execution 14662 error:
onExecutionOpenedWithError @ NodeViewSwitcher-CUwv0PGz.js:14311
(anonymous) @ index-BfLzQZy8.js:93078
emit @ index-BfLzQZy8.js:93078
onOpenExecution @ NodeViewSwitcher-CUwv0PGz.js:14284
await in onOpenExecution
onPostMessageReceived @ NodeViewSwitcher-CUwv0PGz.js:14464
postMessage
loadExecution @ WorkflowPreview-p6m8HW6g.js:64
(anonymous) @ WorkflowPreview-p6m8HW6g.js:137
callWithErrorHandling @ index-BfLzQZy8.js:2423
callWithAsyncErrorHandling @ index-BfLzQZy8.js:2430
baseWatchOptions.call @ index-BfLzQZy8.js:7196
job @ index-BfLzQZy8.js:2160
callWithErrorHandling @ index-BfLzQZy8.js:2423
flushJobs @ index-BfLzQZy8.js:2594
Promise.then
queueFlush @ index-BfLzQZy8.js:2526
queueJob @ index-BfLzQZy8.js:2521
baseWatchOptions.scheduler @ index-BfLzQZy8.js:7208
effect2.scheduler @ index-BfLzQZy8.js:2177
trigger @ index-BfLzQZy8.js:813
endBatch @ index-BfLzQZy8.js:871
notify @ index-BfLzQZy8.js:1102
trigger @ index-BfLzQZy8.js:1089
set value @ index-BfLzQZy8.js:1883
receiveMessage @ WorkflowPreview-p6m8HW6g.js:105
postMessage
emitPostMessageReady @ NodeViewSwitcher-CUwv0PGz.js:14431
(anonymous) @ NodeViewSwitcher-CUwv0PGz.js:14630
Promise.finally
(anonymous) @ NodeViewSwitcher-CUwv0PGz.js:14625
Promise.then
(anonymous) @ NodeViewSwitcher-CUwv0PGz.js:14622
(anonymous) @ index-BfLzQZy8.js:4532
callWithErrorHandling @ index-BfLzQZy8.js:2423
callWithAsyncErrorHandling @ index-BfLzQZy8.js:2430
hook2.__weh.hook2.__weh @ index-BfLzQZy8.js:4517
flushPostFlushCbs @ index-BfLzQZy8.js:2577
flushJobs @ index-BfLzQZy8.js:2613
Promise.then
queueFlush @ index-BfLzQZy8.js:2526
queueJob @ index-BfLzQZy8.js:2521
baseWatchOptions.scheduler @ index-BfLzQZy8.js:7208
effect2.scheduler @ index-BfLzQZy8.js:2177
trigger @ index-BfLzQZy8.js:813
endBatch @ index-BfLzQZy8.js:871
notify @ index-BfLzQZy8.js:1102
trigger @ index-BfLzQZy8.js:1089
set value @ index-BfLzQZy8.js:1883
finalizeNavigation @ index-BfLzQZy8.js:12418
(anonymous) @ index-BfLzQZy8.js:12328
Promise.then
pushWithRedirect @ index-BfLzQZy8.js:12307
push @ index-BfLzQZy8.js:12239
install @ index-BfLzQZy8.js:12574
use @ index-BfLzQZy8.js:5325
(anonymous) @ index-BfLzQZy8.js:352719
NodeViewSwitcher-CUwv0PGz.js:14312 TypeError: Cannot read properties of undefined (reading 'disabled')
    at Workflow.getHighestNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:257:34)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:283:33
    at Array.forEach (<anonymous>)
    at Workflow.getHighestNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:279:33)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:831:46
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1215:20
onExecutionOpenedWithError @ NodeViewSwitcher-CUwv0PGz.js:14312
(anonymous) @ index-BfLzQZy8.js:93078
emit @ index-BfLzQZy8.js:93078
onOpenExecution @ NodeViewSwitcher-CUwv0PGz.js:14284
await in onOpenExecution
onPostMessageReceived @ NodeViewSwitcher-CUwv0PGz.js:14464
postMessage
loadExecution @ WorkflowPreview-p6m8HW6g.js:64
(anonymous) @ WorkflowPreview-p6m8HW6g.js:137
callWithErrorHandling @ index-BfLzQZy8.js:2423
callWithAsyncErrorHandling @ index-BfLzQZy8.js:2430
baseWatchOptions.call @ index-BfLzQZy8.js:7196
job @ index-BfLzQZy8.js:2160
callWithErrorHandling @ index-BfLzQZy8.js:2423
flushJobs @ index-BfLzQZy8.js:2594
Promise.then
queueFlush @ index-BfLzQZy8.js:2526
queueJob @ index-BfLzQZy8.js:2521
baseWatchOptions.scheduler @ index-BfLzQZy8.js:7208
effect2.scheduler @ index-BfLzQZy8.js:2177
trigger @ index-BfLzQZy8.js:813
endBatch @ index-BfLzQZy8.js:871
notify @ index-BfLzQZy8.js:1102
trigger @ index-BfLzQZy8.js:1089
set value @ index-BfLzQZy8.js:1883
receiveMessage @ WorkflowPreview-p6m8HW6g.js:105
postMessage
emitPostMessageReady @ NodeViewSwitcher-CUwv0PGz.js:14431
(anonymous) @ NodeViewSwitcher-CUwv0PGz.js:14630
Promise.finally
(anonymous) @ NodeViewSwitcher-CUwv0PGz.js:14625
Promise.then
(anonymous) @ NodeViewSwitcher-CUwv0PGz.js:14622
(anonymous) @ index-BfLzQZy8.js:4532
callWithErrorHandling @ index-BfLzQZy8.js:2423
callWithAsyncErrorHandling @ index-BfLzQZy8.js:2430
hook2.__weh.hook2.__weh @ index-BfLzQZy8.js:4517
flushPostFlushCbs @ index-BfLzQZy8.js:2577
flushJobs @ index-BfLzQZy8.js:2613
Promise.then
queueFlush @ index-BfLzQZy8.js:2526
queueJob @ index-BfLzQZy8.js:2521
baseWatchOptions.scheduler @ index-BfLzQZy8.js:7208
effect2.scheduler @ index-BfLzQZy8.js:2177
trigger @ index-BfLzQZy8.js:813
endBatch @ index-BfLzQZy8.js:871
notify @ index-BfLzQZy8.js:1102
trigger @ index-BfLzQZy8.js:1089
set value @ index-BfLzQZy8.js:1883
finalizeNavigation @ index-BfLzQZy8.js:12418
(anonymous) @ index-BfLzQZy8.js:12328
Promise.then
pushWithRedirect @ index-BfLzQZy8.js:12307
push @ index-BfLzQZy8.js:12239
install @ index-BfLzQZy8.js:12574
use @ index-BfLzQZy8.js:5325
(anonymous) @ index-BfLzQZy8.js:352719

To Reproduce

Maybe hard to explain or reproduce, it is basically everytime it follows this path:

Image

Using attached workflow:
Post_discord_notification_on_scope_change.json

Expected behavior

Continue executing the workflow like it is designed to be.

Operating System

Ubuntu 20.04.6 LTS

n8n Version

1.76.3

Node.js Version

docker

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Feb 6, 2025

Hey @Fank,

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

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Feb 6, 2025
@Fank
Copy link
Author

Fank commented Feb 6, 2025

using the error execution in editor and then rerun the noop node I get exactly:

Image

As you can see I have values from the Filter node before, so it should just forward them.

@Fank
Copy link
Author

Fank commented Feb 6, 2025

Removing the noop node works perfectly fine:

Image

But even having a connected but disabled noop node, still causes issues:

Image

@Joffcom
Copy link
Member

Joffcom commented Feb 6, 2025

That is really odd the noop node doesn't do anything it just passes on the input.

Are you able to share the json output of the jira trigger and the redis node so we can pin it and see if we can reproduce this?

@Fank
Copy link
Author

Fank commented Feb 6, 2025

@Joffcom Sure but since the jira trigger will may contain sensitive information, is there any way I could send them to you without posting them public?

netroy added a commit that referenced this issue Feb 6, 2025
netroy added a commit that referenced this issue Feb 6, 2025
@netroy
Copy link
Member

netroy commented Feb 6, 2025

The error seems to be coming from this line, which could only happen if somewhere in the code something was messing up nodeName.
I've created a branch to confirm this, and pushed a custom docker image ghcr.io/n8n-io/n8n:debug-13086.

If you can switch to this custom image, we can confirm this theory. Also, when the error happens, can you check the server logs to look for a line containing "node missing in". That might also shed more light on the issue.

@Fank
Copy link
Author

Fank commented Feb 6, 2025

Thanks for providing a debug image, I will update the image once we reached low traffic and post new findings.

@Fank
Copy link
Author

Fank commented Feb 6, 2025

@netroy I updated the image and reimported the same json I attached above (because I modified the workflow to make it work again).

After execution I got the same error again, but this time with Information you added:

Image
"Moved into active sprint1" node missing in [
  'Jira Trigger',
  'Split Out - changelog items',
  'Filter - Sprint',
  'Discord - Create message',
  'Discord - Delete message',
  'Merge2',
  'Save discord message by issue',
  'Delete discord message key',
  'Switch by priority',
  'Set blocker thumbnail',
  'Write discord message',
  'Is not done',
  'No Operation, do nothing1',
  'No Operation, do nothing2',
  'Switch by Status color',
  'Set green color',
  'No Operation, do nothing3',
  'Sticky Note',
  'Sticky Note1',
  'Set red color',
  'Set yellow color',
  'No Operation, do nothing4',
  'Merge move sprint',
  'Get discord message by issue1',
  'Merge',
  'Has discord message',
  'Is in active sprint',
  'Merge1',
  'Has discord message1',
  'No Operation, do nothing',
  'Switch by event type',
  'Filter',
  'Write sprint move action',
  'No Operation, do nothing5',
  'Sticky Note3'
]

IIRC Moved into active sprint1 was an IF node, which I removed.

@Fank
Copy link
Author

Fank commented Feb 6, 2025

I just checked each workflow node again, I can't find any reference to Moved into active sprint1 via UI.

@netroy
Copy link
Member

netroy commented Feb 6, 2025

That just look weird. Can you deactivate the workflow, and reactivate it again, and then check if the issue persists?

@Fank
Copy link
Author

Fank commented Feb 6, 2025

I disabled it, waited a minute and enabled it again:

Image

Image

@netroy
Copy link
Member

netroy commented Feb 6, 2025

Can you please also try duplicating this workflow, deactivating the old workflow, and then activating the new workflow?

@netroy
Copy link
Member

netroy commented Feb 6, 2025

also, would it be possible to for you to share your database with us over support channels?
so far this looks like your DB has ended up in inconsistent state, and we so far have many clues on how that could have happened.
having access to the sqlite file could help us narrow down the issue.

If that's possible, please contact [email protected], with your sqlite file, and a link to this ticket, and we'll try to get this addressed as soon as possible 🙏🏽

@Fank
Copy link
Author

Fank commented Feb 6, 2025

@netroy email has been sent, with all needed Information.

@Fank
Copy link
Author

Fank commented Feb 7, 2025

Not sure, but maybe it could be related to #12159 , the code you changed and the error shown in this issue looks like the behaviour I have.

@netroy
Copy link
Member

netroy commented Feb 7, 2025

Yes, the underlying cause looks to be the same between these two issues. But it's still not clear why the execution engine is using node names that don't exist anymore. we are still investigating.

@netroy
Copy link
Member

netroy commented Feb 17, 2025

We still haven't managed to narrow this down, or reproduce this.

@netroy
Copy link
Member

netroy commented Feb 17, 2025

@Fank Can you download the workflow in question as JSON, open it an editor, and check that the Moved into active sprint1 node exists in the connections section, but not in the nodes section?

@Fank
Copy link
Author

Fank commented Feb 17, 2025

@netroy could you give me a hint of how to access this information?
So far I am only familiar with the normal app usage, not anything developer related.

@Joffcom Joffcom added In Review We are reviewing the issue and removed Needs Feedback Waiting for further input or clarification. labels Feb 18, 2025
@netroy
Copy link
Member

netroy commented Feb 18, 2025

if you open the workflow in your browser, you can use use the menu on the top-right corner to download the workflow as a JSON file

Image.

Once this file is downloaded, you can open it in a text editor locally, to check if the node in questions is defined just in connections or also in nodes.

@Joffcom Joffcom added Needs Feedback Waiting for further input or clarification. and removed In Review We are reviewing the issue labels Feb 18, 2025
@gcampini
Copy link

Had the exact same error (Cannot read properties of undefined (reading 'disabled') ) when executing my workflow. Exporting workflow.json and checking nodes and connections (as @netroy suggested) revealed the issue:

A node in connections referenced a non-existent node (Merge2). Example extract:

"Merge": {
  "main": [
    [
      { "node": "Merge2", "type": "main", "index": 0 },
      { "node": "Loop Over Items", "type": "main", "index": 0 }
    ]
  ]
}

Steps to reproduce:

  1. Create a working workflow
  2. Delete an intermediate node (e.g., Merge2)
  3. Execution fails with Cannot read properties of undefined (reading 'disabled')
  4. workflow.json still references the deleted node in connections

Fix:

  1. Export workflow.json
  2. Remove orphaned connection
  3. Reimport workflow
  4. Works again

Let me know if you need more details! I don't want to share my full workflow.json, so I summarized as much as possible.

@Joffcom Joffcom added In Review We are reviewing the issue and removed Needs Feedback Waiting for further input or clarification. labels Feb 18, 2025
@netroy
Copy link
Member

netroy commented Feb 18, 2025

Thanks for confirming this. I suspect this issue is caused by some recent frontend changes. We'll try to get it fixed in the next day or two.

@Joffcom Joffcom added Needs Feedback Waiting for further input or clarification. and removed In Review We are reviewing the issue labels Feb 18, 2025
@netroy
Copy link
Member

netroy commented Feb 19, 2025

We'll release this fix in a patch release tomorrow morning.

@a-salim-main
Copy link

@netroy issue is still present in latest patch.

@netroy
Copy link
Member

netroy commented Mar 3, 2025

@a-salim-main we'd need more information than that. What nodes are you seeing these errors with? is there a stacktrace that you can share with us? maybe share a screenshot of the error that you see on the frontend.

@Fank
Copy link
Author

Fank commented Mar 4, 2025

@netroy I encountered it with 1.81.4 as well again, this time when migrating our workflows from CE to EE 1.79.3 -> 1.81.4, by downloading JSON and importing it again.
It looks like this time, there was an issue with the a code node.

Image

After removing the code node, everything was fine.

@netroy
Copy link
Member

netroy commented Mar 4, 2025

can you please download the workflow json, open it in an editor, and check if there are any connections for nodes that are not in the workflow?

@Fank
Copy link
Author

Fank commented Mar 4, 2025

@netroy the switch node:

  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          },
          {
            "node": "add billable time",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          },
          {
            "node": "add billable time",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Import worklog delete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },

@netroy
Copy link
Member

netroy commented Mar 10, 2025

We're able to reproduce this now reliably, and are working on a fix.

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 Needs Feedback Waiting for further input or clarification.
Projects
None yet
5 participants