Renderer to Image fails to generate Image in batch mode only on Mac

Hi Team,

In one of our workflow, we have a input SMILES column to a ‘Renderer to Image’ node and have chosen our ‘Canvas 2D’ renderer which renders the SMILES in 2D.

When we run this workflow in batch, on Linux and Windows we could see the output table of ‘Renderer to Image’ populated properly with the 2D image as additional column.

But the same workflow on Mac doesn’t produce any output in ‘Renderer to Image’ table in batch mode. The additional column has empty cells. In GUI mode, it works fine though.

Could you please help me in identifying why the Display.getDefault() throws this stack trace only on Mac? I also see that ‘-XstartOnFirstThread’ is set in Knime.ini file on Mac but still it fails with ‘Invalid thread access’ error.

In the logs I can see the below trace.

DEBUG    KNIME-Worker-0 LocalNodeExecutionJob    Renderer to Image 0:15001 Start execute
DEBUG    KNIME-Worker-0 CanvasSmilesRenderer     Unable to paint smiles "CO": Invalid thread access
org.eclipse.swt.SWTException: Invalid thread access
        at org.eclipse.swt.SWT.error(
        at org.eclipse.swt.SWT.error(
        at org.eclipse.swt.SWT.error(
        at org.eclipse.swt.widgets.Display.error(
        at org.eclipse.swt.widgets.Display.createDisplay(
        at org.eclipse.swt.widgets.Display.create(
        at org.eclipse.swt.widgets.Display.<init>(
        at org.eclipse.swt.widgets.Display.<init>(
        at org.eclipse.swt.widgets.Display.getDefault(
        at com.schrodinger.knime.type.smiles.CanvasSmilesRenderer.paintComponent(
        at javax.swing.JComponent.paint(
        at org.knime.base.node.renderer2image.Renderer2ImageNodeModel.createPngCell(
        at org.knime.base.node.renderer2image.Renderer2ImageNodeModel$3.getCell(
        at org.knime.core.node.ExecutionContext.createColumnRearrangeTable(
        at org.knime.base.node.renderer2image.Renderer2ImageNodeModel.execute(
        at org.knime.core.node.NodeModel.execute(
        at org.knime.core.node.NodeModel.executeModel(
        at org.knime.core.node.Node.invokeFullyNodeModelExecute(
        at org.knime.core.node.Node.execute(
        at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(
        at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(
        at org.knime.core.node.workflow.NodeExecutionJob.internalRun(
        at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(
        at org.knime.core.util.ThreadUtils$
        at java.util.concurrent.Executors$
        at org.knime.core.util.ThreadPool$
        at org.knime.core.util.ThreadPool$

Do we have an update for this?

Hi Ravikiran,

While we investigate the issue, would not it make sense to run these workflows via the KNIME Server?