Knime 4.4 Cant merge variable stacks! (likely a loop problem)

Good afternoon,
We are encountering an error when running a job through the Knime webportal.
We have 2 table row to variable loops starts and loop ends (shown in screenshot) that work fine on the local workflow, or even when running a server job locally.

However, when running the workflow through the webportal, the job fails and upon analysis we are receiving the error “Cant merge variable stacks! (likely a loop problem)”

Within the metanode “promote column headers”, the failing nodes are shown as such:

Please can you assist us.
Thanks in advance,
Joshua

Hi @joshuash,

are you allowed to share you workflow with some example data (maybe some fake data), so I can have a look at it and try it out?

Cheers
Kathrin

I see 3 things in this WF that are not as they should be:

  1. In the upper screenshot, the empty table switch has no End If Node attached (The End If has to be in the same scope as the If Switch, so within the Case Switch). edit: In this case, it seems the Case Switch End Node takes care of the dangling Empty Table Switch. Quite smart.
  2. In the lower screenshot, the Column Filter has a deactivated output, despite being in the active branch of the case switch.
  3. In my version (KNIME AP 4.5), the Case Switch End Nodes wants all inputs connected, it won’t work with only input 1 and 2 connected. This appears in both screenshots. Never used a Case Switch Node before, so I can’t tell how it works with 4.4.

My 2 cents, hope it’s helpful.

1 Like

@joshuash beside what @Thyme is saying these things come to my mind:

  • (especially) with nested loops it can make sense to use Metanodes in order to make sure what part of the loop will do what and how they are wired. You can check „select sope“ by right clicking on the Loop node and see how KNIME would interpret the wiring.
  • it might very well be necessary to check the logic behind the loop and if it would work in every constellation. It might be necessary to provide a dummy table of the same structure at the end of a loop or try catch block (Try Catch 1, Try Catch 2)
  • you could educate yourself abut loops with this collection or with @armingrudd articles

Example for the use of if and CASE nodes (with Python nodes but could be any other nodes also):

1 Like

Hello everyone,

That error message seems to happen when an operation is not properly closed (Loop End, IF/Case End, etc).

However, the tricky part here is that, based on what @joshuash said, this workflow actually works when run as a back-end, but only fails when it’s run via the webportal.

If I look at the first screenshot, while what @Thyme said is true:

but this also created another IF Switch, in the form of an Empty Table Switch, which is not closed. That Empty Table Switch is never closed. Not the best design, I would replace that node with something else that’s not a Switch, or you can just add an End IF node right after it, and then link that End IF node to the Table Creator:
image

1 Like

Thank you all very much for the helpful responses. We have managed to sort the issue by removing the outer loop and some workarounds.
I appreciate the assistance

3 Likes

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