Error - Execute Failed: Stream Closed

Hello,

I’m working in Version 5.2 of KNIME and was running the workflow below when I came across the error Execute Failed: Stream Closed.

image

There are 12 files in the folder that it is looping through. I tried running the same with half the files at a time and it seemed to run fine. I also tried adding a “Wait” node after the “variable loop start” node but was still coming across the same error. What does this error mean and how do I go about solving this?

Thank you!

Hey @arushib30,

From your description of the issue, it seems it may be related to resource allocation as you said the workflow runs fine when you pass in less files, and it seems to break when you try to run it on all 12. I would try specifying more resource allocation and see if it fixes the issue you are running into.

Here is a post on how to increase memory on KNIME:

https://forum.knime.com/t/change-memory-on-knime-ini/43472/5

Hope this helps,
TL

2 Likes

Hi @arushib30,

the error message is coming from very deep inside the implementation (it’s Java’s IOException and “Stream closed” means it tries to read from the input stream after it is already closed).

I would be glad if you could provide me with a “stacktrace” from the log file so I can diagnose it further.
To obtain such a stacktrace, set the logfile log level to “DEBUG” in the Preferences, execute the loop again until the exception occurs, and then search in the knime.log for the exception “Stream closed”. You should find a stacktrace right below it. You can find the logfile easily via the top right corner “Menu” → “Show KNIME log in File Explorer”.

A workaround could also be to use the Excel Reader’s ability to directly read in a bunch of files inside a folder instead of looping explicitly. It should more or less have the same functionality as the List Files/Folders node. You just have to select “Files in folder”, configure Filter options if you need to only read in files following a filename pattern, and optionally tick the “Include subfolders” option if you want to read files deeper in the folder hierarchy.

Best,
Manuel

3 Likes