Code node "Unknown Error" for no obvious reason

n8n cloud, 1.107.4

I am getting “Unknown Error” on a Code node that worked dozens of times already while testing a long workflow.
I tried to just change the way I was doing things and replaced it with 2 other nodes instead (if node etc) that did the same process, so the next code node just failed with the same error. It makes no sense since these nodes worked fine uninterrupted until one time they just stopped working.

The only thing I can think of is the fact that I duplicated the workflow to do some testing and this started happening right after that. I since moved the duplicate to archive, no change.

Makes absolutely no sense why it would fail :frowning:

Would love to get some help!!!
Thanks!

Hey @Yoni_Bagelman hope all is well. Welcome to the community.

Is this something that can be reproduced? Can you show us how to make it fail?

Sure, @jabbson, every time I run the workflow it just fails.

Apologies, what I meant was - if this is something I can run and reproduce?

Can you pin the input data before the Code node and share your workflow?


@jabbson this is the part that is failing (the last node)

The “last” as in “Filter Old”? It appears to be a part of the loop, but it doesn’t loop back to anything? Currently, if I run this workflow, is successfully runs one (as expected due to the loop being broken)

1 Like

@jabbson - Yes this is just the first part of the workflow, it loops back from later nodes.

So the “filter old” works on your end? that’s nice I guess, I just don’t know what to do about my end :sweat_smile:

I have one theory and it’s that it’s the browser being slow that is causing this, but I have restarted everything and closed all tabs and deleted cache, and it’s still not working.

If you have any recommendations , I’m all ears.

Could you show the code node after the execution?
Also try to create a duplicate new workflow with same nodes and see if that changes anything.

Like this?

@jabbson same error on duplicate

Then you should probably start debugging your code and see which line produces the error. Throw some log statements through out the code and see which ones are printed in the console, narrow down the line that makes the code fail.

@jabbson So when I copy paste it 1 quarter at a time and add them together 1 by 1 - it works for a small piece, I add the other piece and execute and it works, I add another piece and it works, until it stops working when it gets longer.
Last night this exact workflow worked fine, this node passed dozens of times, it’s not the code.
If I remove this particular code node it just fails on the next one.
Is there a limit to the length of an n8n workflow? I can’t imagine I’ve built a particularly long one here…

I don’t believe that the length is what is causing it, I wish I could reproduce this, but I can’t. Do you see any errors in the web console or in docker logs (unless you are running this in the cloud)?

This is in n8n cloud

Could still be something in the web console

The solution is that you must connect your node code to done so that it delivers the file and loop is what returns for the next one.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.