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(SWT.java:4533)
        at org.eclipse.swt.SWT.error(SWT.java:4448)
        at org.eclipse.swt.SWT.error(SWT.java:4419)
        at org.eclipse.swt.widgets.Display.error(Display.java:1089)
        at org.eclipse.swt.widgets.Display.createDisplay(Display.java:840)
        at org.eclipse.swt.widgets.Display.create(Display.java:823)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:129)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:722)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:713)
        at org.eclipse.swt.widgets.Display.getDefault(Display.java:1419)
        at com.schrodinger.knime.type.smiles.CanvasSmilesRenderer.paintComponent(CanvasSmilesRenderer.java:218)
        at javax.swing.JComponent.paint(JComponent.java:1056)
        at org.knime.base.node.renderer2image.Renderer2ImageNodeModel.createPngCell(Renderer2ImageNodeModel.java:364)
        at org.knime.base.node.renderer2image.Renderer2ImageNodeModel$3.getCell(Renderer2ImageNodeModel.java:259)
        at org.knime.core.data.container.SingleCellFactory.getCells(SingleCellFactory.java:105)
        at org.knime.core.data.container.RearrangeColumnsTable.calcNewCellsForRow(RearrangeColumnsTable.java:503)
        at org.knime.core.data.container.RearrangeColumnsTable.calcNewColsSynchronously(RearrangeColumnsTable.java:424)
        at org.knime.core.data.container.RearrangeColumnsTable.create(RearrangeColumnsTable.java:342)
        at org.knime.core.node.ExecutionContext.createColumnRearrangeTable(ExecutionContext.java:371)
        at org.knime.base.node.renderer2image.Renderer2ImageNodeModel.execute(Renderer2ImageNodeModel.java:174)
        at org.knime.core.node.NodeModel.execute(NodeModel.java:733)
        at org.knime.core.node.NodeModel.executeModel(NodeModel.java:567)
        at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1172)
        at org.knime.core.node.Node.execute(Node.java:959)
        at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
        at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
        at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
        at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
        at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
        at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
        at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

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?

Regards,
Medzi