knime-ip / knip-ilastik

KNIP / Ilastik Integration (BETA)
5 stars 1 forks source link

Improve error reporting #24

Open stelfrich opened 4 years ago

stelfrich commented 4 years ago

It seems that under certain circumstances (see https://forum.knime.com/t/ilastik-output-file-does-not-exist-error/13734 for more details), expected output files are not available. In such cases, some indication of what has gone wrong should be provided instead of just throwing an exception like:

Caused by: java.nio.file.InvalidPathException: Ilastik output file does not exist: D:\Users\zeiss\AppData\Local\Temp/ilastik/6efb518d-7f62-4140-8b08-122415b18093/file0_result.tiff
JennyKSSI commented 2 months ago

Hi, I'm getting the same errors described in this Knime community forum and I don't see any solutions in that thread. I just updated Knime two days ago and I'm running Ilastik 1.4.0. Did anyone figure out a fix?

I'm actually getting a lot of errors when I try to run and I don't know how to address them. My paths to the Ilastik .exe file in Knime>Preferences and to the .ilp file in node configuration are both correct, and I have the .ilp file open when I try to execute the node.

WARN  KNIPLogService                  WARNING 2024-07-31 09:52:44,676 opConservationTracking 25004 25896 Could not find any ILP solver
WARN  KNIPLogService                  WARNING 2024-07-31 09:52:44,841 opStructuredTracking 25004 25896 Could not find any ILP solver
WARN  KNIPLogService                  WARNING 2024-07-31 09:52:44,843 structuredTrackingWorkflow 25004 25896 Could not find any learning solver. Tracking will use flow-based solver (DPCT). Learning for tracking will be disabled!
ERROR KNIPLogService                  ERROR 2024-07-31 09:53:00,572 excepthooks 25004 25896 Unhandled exception in thread: 'MainThread'
ERROR KNIPLogService                  ERROR 2024-07-31 09:53:00,575 excepthooks 25004 25896 Traceback (most recent call last):
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\ilastik\shell\projectManager.py", line 150, in openProjectFile
ERROR KNIPLogService                      hdf5File = h5py.File(projectFilePath, mode)
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\h5py\_hl\files.py", line 533, in __init__
ERROR KNIPLogService                      fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\h5py\_hl\files.py", line 226, in make_fid
ERROR KNIPLogService                      fid = h5f.open(name, flags, fapl=fapl)
ERROR KNIPLogService                    File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
ERROR KNIPLogService                    File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
ERROR KNIPLogService                    File "h5py\h5f.pyx", line 106, in h5py.h5f.open
ERROR KNIPLogService                  OSError: [Errno 0] Unable to open file (unable to lock file, errno = 0, error message = 'No error', Win32 GetLastError() = 33)
ERROR KNIPLogService                  
ERROR KNIPLogService                  During handling of the above exception, another exception occurred:
ERROR KNIPLogService                  
ERROR KNIPLogService                  Traceback (most recent call last):
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\Scripts\ilastik-script.py", line 9, in <module>
ERROR KNIPLogService                      sys.exit(main())
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\ilastik_scripts\ilastik_startup.py", line 146, in main
ERROR KNIPLogService                      main()
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\ilastik\__main__.py", line 30, in main
ERROR KNIPLogService                      hShell = app.main(parsed_args, workflow_cmdline_args)
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\ilastik\app.py", line 204, in main
ERROR KNIPLogService                      f(shell)
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\ilastik\app.py", line 399, in loadProject
ERROR KNIPLogService                      shell.openProjectFile(path, parsed_args.readonly)
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\ilastik\shell\headless\headlessShell.py", line 94, in openProjectFile
ERROR KNIPLogService                      hdf5File, workflow_class, readOnly = ProjectManager.openProjectFile(projectFilePath, force_readonly)
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\ilastik\shell\projectManager.py", line 153, in openProjectFile
ERROR KNIPLogService                      hdf5File = h5py.File(projectFilePath, "r")
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\h5py\_hl\files.py", line 533, in __init__
ERROR KNIPLogService                      fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
ERROR KNIPLogService                    File "C:\Program Files\ilastik-1.4.0\lib\site-packages\h5py\_hl\files.py", line 226, in make_fid
ERROR KNIPLogService                      fid = h5f.open(name, flags, fapl=fapl)
ERROR KNIPLogService                    File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
ERROR KNIPLogService                    File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
ERROR KNIPLogService                    File "h5py\h5f.pyx", line 106, in h5py.h5f.open
ERROR KNIPLogService                  OSError: [Errno 0] Unable to open file (unable to lock file, errno = 0, error message = 'No error', Win32 GetLastError() = 33)
ERROR KNIPLogService                  
ERROR KNIPLogService                  ilastik error: 
ERROR KNIPLogService                  The operation completed successfully.
ERROR KNIPLogService                  
ERROR KNIPLogService                  
ERROR Ilastik Headless (Pixel classification) 4:3        [ERROR] Error while executing Ilastik.
java.lang.IllegalStateException: Can't read image in Ilastik Headless Node at RowId: 264a.tif : java.nio.file.InvalidPathException: Ilastik output file does not exist: C:\Users\JennyKay\AppData\Local\Temp/ilastik/f94025ff-95a3-4634-a88f-fdbbd9f6eecf/file0_result.tiff
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.readResultImages(IlastikHeadlessNodeModel.java:378)
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.execute(IlastikHeadlessNodeModel.java:314)
    at org.knime.core.node.NodeModel.execute(NodeModel.java:812)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:588)
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1286)
    at org.knime.core.node.Node.execute(Node.java:1049)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:594)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:98)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:198)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:367)
    at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:221)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.nio.file.InvalidPathException: Ilastik output file does not exist: C:\Users\JennyKay\AppData\Local\Temp/ilastik/f94025ff-95a3-4634-a88f-fdbbd9f6eecf/file0_result.tiff
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.readImageForRow(IlastikHeadlessNodeModel.java:408)
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.readResultImages(IlastikHeadlessNodeModel.java:372)
    ... 15 more

ERROR Ilastik Headless (Pixel classification) 4:3        Execute failed: java.lang.IllegalStateException: Can't read image in Ilastik Headless Node at RowId: 264a.tif : java.nio.file.InvalidPathException: Ilastik output file does not exist: C:\Users\JennyKay\AppData\Local\Temp/ilastik/f94025ff-95a3-4634-a88f-fdbbd9f6eecf/file0_result.tiff