Dear all,
I have recently experienced a very nasty case of workflow corruption. A linux workstation suffered a hard crash (resembling power failure). The workflow was saved just a few minutes before the crash but still open and running a subset of nodes. Upon rebooting the machine and re-opening Knime and the workflow, it turned out that only blank space is opened into Knime GUI (without any warnings). Closer inspection shows that all the contents of the workflow are still in place in the correct folder of the workspace. However, workflow.knime has become corrupted and lacks all the information of nodes and connections (file attached).
I can still see the nodes and connections in the workflow.svg but obviously it is helping only a tiny bit. The workflow itself is quite massive and of great importance. Is there any way to try to rescue the workflow itself?
Many thanks for your assistance!
Kind regards,
Heikki
Dear Heikki:
Although we have been discussing this by email already I just want to summarize our findings so far.
In short: it doesn't look good. Although all the node folders (and also contained metanode folders) seem intact the main workflow file is corrupt. That file usually contains the connection information (which node is connected where) and that will involve a lot of manual editing of the workflow file to reassemble the connection graph from the SVG. Each connection would need to be manually added, small xml pieces like this:
<config key="connection_0">
<entry key="sourceID" type="xint" value="1"/>
<entry key="destID" type="xint" value="2"/>
<entry key="sourcePort" type="xint" value="1"/>
<entry key="destPort" type="xint" value="1"/>
</config>
That workflow must mean a lot to you if that justifies the work.
More discussion ongoing by email...
A bit of a similar experience, in this case on Windows 7.0. One node was still running in a freshly saved Workflow when the system crashed.
When trying to open the Workflow, Knime issues an error message:
java.io.IOException: Unable to parse xml: line=1: Content is not allowed in prolog.
xml: URI=java.io.BufferedInputStream@1dbe2a
dtd: URI=null
and it seems the workflow.knime in the base library is corrupted, even though the full directory structure below is intact. From the previous post I kind of conclude that this Workflow as such is beyond saving (of course I would be happy to be proven wrong here)...
The Workflow contains, however, collapsed nodes. The question is: can such a collapsed node salvaged from this corrupted project? More generally, can the individual nodes copied somehow to a fresh project?
java.io.IOException: Unable to parse xml: line=1: Content is not allowed in prolog.
xml: URI=java.io.BufferedInputStream@1dbe2a
dtd: URI=null
That sounds as if the VM went down while saving the XML. Weird!
The question is: can such a collapsed node salvaged from this corrupted project? More generally, can the individual nodes copied somehow to a fresh project?
Theoretically yes but haven't tried myself yet. You would create an empty workflow and save it (or say you add one dummy node just for reference). Then you take a node folder from the corrupted workflow and copy it over and add an entry into the (almost) empty workflow.knime. There is a "nodes" section that references the contained node folders, e.g.:
<config key="node_2">
<entry key="id" type="xint" value="2" />
<entry key="node_settings_file" type="xstring" value="AutoEncoder Layer (#2)/settings.xml" />
<entry key="node_is_meta" type="xboolean" value="false" />
<entry key="node_type" type="xstring" value="NativeNode" />
<entry key="ui_classname" type="xstring" value="org.knime.core.node.workflow.NodeUIInformation" />
<config key="ui_settings">
<config key="extrainfo.node.bounds">
<entry key="array-size" type="xint" value="4" />
<entry key="0" type="xint" value="264" />
<entry key="1" type="xint" value="17" />
<entry key="2" type="xint" value="133" />
<entry key="3" type="xint" value="79" />
</config>
</config>
</config>
The ID would need to be unique; and the ui_* fields can be omitted, I guess. The node_type is one of NativeNode, MetaNode, SubNode.