Batch mode troubles

I am trying to run a basic batch mode of one of the examples that ships with KNIME, the Retail/Finding Associations… workflow.
I am using this command:

"C:\Program Files\KNIME\knime.exe" --launcher.suppressErrors -nosplash -consoleLog -nosave -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="C:\Users\<user>\knime-workspace\Example Workflows\Retail\Finding Association Rules for Market Basket Analysis" -noexit

I get a NullPointerException for the File Reader node, can someone explain what I am doing wrong?

Here’s the full error:

Aug 21, 2021 7:06:23 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions
INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-frontend-jaxrs (390) [org.apache.cxf.jaxrs.JAXRSBindingFactory]
Aug 21, 2021 7:06:23 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions
INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-transports-http (393) [org.apache.cxf.transport.http.HTTPTransportFactory, org.apache.cxf.transport.http.HTTPWSDLExtensionLoader, org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder, org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder, org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]
Aug 21, 2021 7:06:23 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions
INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-transports-http-hc (394) [org.apache.cxf.transport.http.HTTPConduitFactory, org.apache.cxf.transport.ConduitInitiator]
Aug 21, 2021 7:06:23 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register
INFO: Aries Blueprint packages not available. So namespaces will not be registered
Aug 21, 2021 7:06:23 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register
INFO: Aries Blueprint packages not available. So namespaces will not be registered
ERROR KNIME-Worker-0-Table Reader 0:129 Node Execute failed: (“NullPointerException”): null
java.lang.NullPointerException
at org.knime.filehandling.core.connections.knimerelativeto.LocalRelativeToWorkflowFSConnection.(LocalRelativeToWorkflowFSConnection.java:99)
at org.knime.filehandling.core.connections.meta.base.BaseFSDescriptor$Builder.lambda$0(BaseFSDescriptor.java:245)
at org.knime.filehandling.core.connections.DefaultFSConnectionFactory.createRelativeToConnection(DefaultFSConnectionFactory.java:137)
at org.knime.filehandling.core.defaultnodesettings.FileSystemHelper.retrieveFSConnection(FileSystemHelper.java:122)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getConnection(FileChooserPathAccessor.java:138)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.initializeFileSystem(FileChooserPathAccessor.java:145)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getOutputPath(FileChooserPathAccessor.java:162)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getRootPath(FileChooserPathAccessor.java:293)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getFSPaths(FileChooserPathAccessor.java:202)
at org.knime.filehandling.core.node.table.reader.paths.PathSettings$1.getItems(PathSettings.java:105)
at org.knime.filehandling.core.node.table.reader.TableReaderNodeModel.getPaths(TableReaderNodeModel.java:195)
at org.knime.filehandling.core.node.table.reader.TableReaderNodeModel.execute(TableReaderNodeModel.java:158)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:556)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1259)
at org.knime.core.node.Node.execute(Node.java:1039)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:559)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:365)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:219)
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)
ERROR KNIME-Worker-2-Table Reader 0:128 Node Execute failed: (“NullPointerException”): null
java.lang.NullPointerException
at org.knime.filehandling.core.connections.knimerelativeto.LocalRelativeToWorkflowFSConnection.(LocalRelativeToWorkflowFSConnection.java:99)
at org.knime.filehandling.core.connections.meta.base.BaseFSDescriptor$Builder.lambda$0(BaseFSDescriptor.java:245)
at org.knime.filehandling.core.connections.DefaultFSConnectionFactory.createRelativeToConnection(DefaultFSConnectionFactory.java:137)
at org.knime.filehandling.core.defaultnodesettings.FileSystemHelper.retrieveFSConnection(FileSystemHelper.java:122)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getConnection(FileChooserPathAccessor.java:138)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.initializeFileSystem(FileChooserPathAccessor.java:145)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getOutputPath(FileChooserPathAccessor.java:162)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getRootPath(FileChooserPathAccessor.java:293)
at org.knime.filehandling.core.defaultnodesettings.filechooser.FileChooserPathAccessor.getFSPaths(FileChooserPathAccessor.java:202)
at org.knime.filehandling.core.node.table.reader.paths.PathSettings$1.getItems(PathSettings.java:105)
at org.knime.filehandling.core.node.table.reader.TableReaderNodeModel.getPaths(TableReaderNodeModel.java:195)
at org.knime.filehandling.core.node.table.reader.TableReaderNodeModel.execute(TableReaderNodeModel.java:158)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:556)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1259)
at org.knime.core.node.Node.execute(Node.java:1039)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:559)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:365)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:219)
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)

Hi,
is this really a workflow directory or are you referring to an actula workflow?
(workflowDir = …)
In addition on top of the pop up error message there is normally an error code numer (0-5 I think) which helps to identifiy the kind of error
br

It is an actual KNIME workflow (uncompressed) - the directory where KNIME stores all node configuration subfolders and the metadata. The batch job appears to kick off and the workflow attempts to run, but it encounters the Table Reader error.
This being an example workflow, it should be rather simple for others to test (using the command line I have provided in the original post) and investigate the workflow; is this error reproducible? Is it a KNIME related issue or a local issue?
The error code that was produced:

Knime:
Java was started but returned exit code=4
-server
-Dsun.java2d.d3d=false
-Dosgi.classloader.lock=classname
-XX:+UnlockDiagnosticVMOptions
-XX:+UseG1GC
-Dsun.net.client.defaultReadTimeout=0
-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot
-Xmx15130m
-Dorg.eclipse.swt.browser.IEVersion=11001
-Dsun.awt.noerasebackground=true
-Dequinox.statechange.timeout=30000
-Djava.class.path=C:\Program Files\KNIME\\plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
-os win32
-ws win32
-arch x86_64
-launcher C:\Program Files\KNIME\knime.exe
-name Knime
--launcher.library C:\Program Files\KNIME\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.100.v20210209-1541\eclipse_11301.dll
-startup C:\Program Files\KNIME\\plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
--launcher.overrideVmargs
-nosave
-reset
-application org.knime.product.KNIME_BATCH_APPLICATION
-workflowDir=C:\Users\<user>\knime-workspace\Example Workflows\Retail\Finding Association Rules for Market Basket Analysis
-vm C:\Program Files\KNIME\\plugins/org.knime.binary.jre.win32.x86_64_11.0.10.20210416/jre/bin\client\jvm.dll
-vmargs
-server
-Dsun.java2d.d3d=false
-Dosgi.classloader.lock=classname
-XX:+UnlockDiagnosticVMOptions
-XX:+UseG1GC
-Dsun.net.client.defaultReadTimeout=0
-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot
-Xmx15130m
-Dorg.eclipse.swt.browser.IEVersion=11001
-Dsun.awt.noerasebackground=true
-Dequinox.statechange.timeout=30000
-Djava.class.path=C:\Program Files\KNIME\\plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar 

Hi @davekalpak , your command line seems to be ok and it looks like you are pointing at the right place with the workflowDir. Can you please share the configuration of the Table Reader?

This workflow is one of the example workflows that ships with KNIME. I was able to run it in GUI mode. I have exported the example workflow for others to review, but it is readily found on all installations of KNIME. I have not modified the example workflow in any way.
Finding Association Rules for Market Basket Analysis.knwf (45.9 KB)

Hi @davekalpak , unfortunately I cannot run this workflow as it’s meant for v4.4. I’m still on 4.3.

I believe it’s the data path problem.

You can try to use local file system path instead of relative path

Based on the error message, that’s what I believe too, that’s why I asked to see the configuration in the first place, but got the workflow instead, which usually is the best, but unfortunately I can’t use the workflow as I’m not on the same Knime version.

Thanks for showing the configuration @HaveF.

@davekalpak When you use Relative to, it’s looking into the workflow’s data folder, and the workflow’s data folder is empty, so that file is not in the data folder. And also, the highest level you can go is the workflow’s data root folder, so …/…/ isn’t going to go outside that.

You need to use local file system instead if it’s not in the data folder and point to the table file.

Thank you both for assisting with this. I was able to run the workflow once I convert the path to local absolute path. It’s quite odd that the relative path (relative to workflow) will work in GUI mode but not in batch mode, even when I initiate the command from within the workflow directory.

Workflow path, workspace mount path are all mysteries in batch mode. At least for me :smiley:

Like some have said using the ‘Relative To’ option doesn’t work in Batch (for me at least).

You can use the ‘Custom/KNIME URL’ option, however, with KNIME://knime.workflow/ working for me.

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