KNIME 4.7: corrupting workflows - removing custom nodes

Last week I had at least one workflow getting partially reset when loading and connections going nowhere and a node with no input. It confused me but I think just some strange error.

I now realized that KNIME 4.7 seems to delete some nodes on opening a workflow. here is an example:

image

Notice the missing connection from Row Splitter to Column Filter. Since these are older workflows it’s hard to know what actually happened here but in this case the metanode has a name that tells me exactly what was removed: one of my custom nodes.

I have part of the log below which is probably relevant. No t be totally fair the issue probably occurs because I need to update the nodes? Some guide what part to update would be welcome.

Anyway the core probelm here is the behavior of KNIME. KNIME should not just delete an invalid node. It should fail to load the workflow and make the error more clear. The console is riddled with error messages about the workflow reset. The fact a node failed to load and was omitted is easily missed in the sea of the other, not very uncommon errors.

Removing a node in the middle of the workflow makes the workflow unusable anyway on top of it if you don’t immediately notice the issue you will save it and then the workflow is corrupted as you might not remember what exactly was removed.

Probably relevant part from log:

2023-02-06 07:01:43,594 : DEBUG : ModalContext :  : RowFilter2PortNodeFactory : StructureToName : 3:160:169 : Factory is already initialized. Nothing to do.
2023-02-06 07:01:43,597 : DEBUG : ModalContext :  : AppendedRowsNodeFactory : StructureToName : 3:160:169 : Factory is already initialized. Nothing to do.
2023-02-06 07:01:43,598 : DEBUG : ModalContext :  : HiLiteHandler : StructureToName : 3:160:169 : Adding hilite manager to handler 2c77eade-45c2-49a5-82a3-8e5c392f12c3
2023-02-06 07:01:43,598 : DEBUG : ModalContext :  : HiLiteHandler : StructureToName : 3:160:169 : Adding hilite translator to handler 739d08ae-27d8-48fc-9f41-af1defda2f03
2023-02-06 07:01:43,601 : DEBUG : ModalContext :  : StructureToNameNodeFactory : StructureToName : 3:160:169 : Factory is already initialized. Nothing to do.
2023-02-06 07:01:43,602 : ERROR : ModalContext :  : FileWorkflowPersistor : StructureToName : 3:160:169 : Unable to load node with ID suffix 166 into workflow, skipping it: Found interface org.knime.core.node.workflow.WorkflowContext, but class was expected
java.lang.IncompatibleClassChangeError: Found interface org.knime.core.node.workflow.WorkflowContext, but class was expected
	at com.givaudan.knime.internal.StructureToNameNodeModel.getWorkingDir(StructureToNameNodeModel.java:172)
	at com.givaudan.knime.internal.StructureToNameNodeModel.<init>(StructureToNameNodeModel.java:56)
	at com.givaudan.knime.internal.StructureToNameNodeFactory.createNodeModel(StructureToNameNodeFactory.java:13)
	at com.givaudan.knime.internal.StructureToNameNodeFactory.createNodeModel(StructureToNameNodeFactory.java:1)
	at org.knime.core.node.NodeFactory.callCreateNodeModel(NodeFactory.java:520)
	at org.knime.core.node.Node.<init>(Node.java:307)
	at org.knime.core.node.workflow.FileNativeNodeContainerPersistor.preLoadNodeContainer(FileNativeNodeContainerPersistor.java:197)
	at org.knime.core.node.workflow.FileWorkflowPersistor.loadNodeContainer(FileWorkflowPersistor.java:979)
	at org.knime.core.node.workflow.WorkflowManager.postLoad(WorkflowManager.java:8698)
	at org.knime.core.node.workflow.WorkflowManager.loadContent(WorkflowManager.java:8600)
	at org.knime.core.node.workflow.WorkflowManager.postLoad(WorkflowManager.java:8714)
	at org.knime.core.node.workflow.WorkflowManager.loadContent(WorkflowManager.java:8600)
	at org.knime.core.node.workflow.WorkflowManager.postLoad(WorkflowManager.java:8714)
	at org.knime.core.node.workflow.WorkflowManager.loadContent(WorkflowManager.java:8600)
	at org.knime.core.node.workflow.WorkflowManager.load(WorkflowManager.java:8464)
	at org.knime.core.node.workflow.WorkflowManager.load(WorkflowManager.java:8385)
	at org.knime.core.node.workflow.WorkflowManager.load(WorkflowManager.java:8358)
	at org.knime.core.node.workflow.WorkflowManager.loadProject(WorkflowManager.java:8202)
	at org.knime.workbench.editor2.LoadWorkflowRunnable.run(LoadWorkflowRunnable.java:171)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
2023-02-06 07:01:43,608 : DEBUG : ModalContext :  : ColumnMergerNodeFactory : StructureToName : 3:160:169 : Factory is already initialized. Nothing to do.
2023-02-06 07:01:43,611 : DEBUG : ModalContext :  : DataColumnSpecFilterNodeFactory : StructureToName : 3:160:169 : Factory is already initialized. Nothing to do.
2023-02-06 07:01:43,615 : DEBUG : ModalContext :  : StringManipulationNodeFactory : StructureToName : 3:160:169 : Factory is already initialized. Nothing to do.
2023-02-06 07:01:43,616 : DEBUG : ModalContext :  : WorkflowManager :  :  : Added new connection from node 3:160:169:163(1) to node 3:160:169:165(1)
2023-02-06 07:01:43,616 : DEBUG : ModalContext :  : WorkflowManager :  :  : Added new connection from node 3:160:169(0) to node 3:160:169:169(1)
2023-02-06 07:01:43,616 : DEBUG : ModalContext :  : WorkflowManager :  :  : Added new connection from node 3:160:169:165(1) to node 3:160:169(0)
2023-02-06 07:01:43,616 : DEBUG : ModalContext :  : WorkflowManager :  :  : Added new connection from node 3:160:169:169(1) to node 3:160:169:163(1)
2023-02-06 07:01:43,616 : DEBUG : ModalContext :  : WorkflowManager :  :  : Added new connection from node 3:160:169:168(1) to node 3:160:169:165(2)
2023-02-06 07:01:43,616 : DEBUG : ModalContext :  : WorkflowManager :  :  : Added new connection from node 3:160:169:167(1) to node 3:160:169:168(1)
2023-02-06 07:01:43,620 : DEBUG : ModalContext :  : Node : Column Merger : 3:160:169:167 : reset
1 Like

Thanks @kienerj for the detailed feedback. Let me ask internally to see if someone can take a look at this more closely.

Due to updating the version of Eclipse, KNIME AP 4.7 did bring some big changes to how some community extensions need to be implemented; your custom nodes may have the same issues.

@gab1one posted some details on updating extensions for 4.7 here:

A full log file (including startup messages) may give more information on the possibly broken extension. Assuming an incompatible plugin is the issue, updating the plugin may be the best solution.

Sorry for the trouble here. If you need additional info I hope Gabriel will be able to help. In that spirit I’ve moved this thread to the Node Development category.

Hi @kienerj,

I am sorry to see you are having this issue, the behavior of AP in case of fatal errors during Node construction is not ideal, we will look into improving this.

It looks like you have been using the WorkflowContext class in the constructor of your node model. With 4.7 we changed the workflowcontext from a class to an interface. This class is part of the internal API and not intended to be used by external extension, which is also noted in its JavaDoc, this is why in this breaking fashion without an explicit warning to extension developers.

To fix this, you need to compile your extensions targeting 4.7. To do so, set your target platform to 4.7 (releases/2022-12) and then take a look at the compile errors you might get and fix those.

best,
Gabriel

1 Like

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