Execution failure of PhantomJSImageGenerator on Linux machines

Hello everyone,

I would like to use plots using JavaScript on Linux machines but failed with the following errors:


Console:

WARN KNIMEApplication$3 Potential deadlock in SWT Display thread detected. Full thread dump will follow as debug output.
WARN Scatter Plot (JavaScript) 0:1 Data table must have at least one numerical or categorical column.
ERROR Scatter Plot (JavaScript) 0:3 Execute failed: org/knime/ext/phantomjs/PhantomJSImageGenerator


$HOME/phantomjs.log

(nothing reported)


knime-workspace/.metadata/knime/knime.log

2018-06-21 11:32:52,774 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer : : : ROOT has new state: IDLE
2018-06-21 11:32:54,724 : DEBUG : main : NodeContainerEditPart : : : Scatter Plot (JavaScript) 0:3 (CONFIGURED)
2018-06-21 11:32:55,815 : DEBUG : main : ExecuteAction : : : Creating execution job for 1 node(s)…
2018-06-21 11:32:55,816 : DEBUG : main : NodeContainer : : : Scatter Plot (JavaScript) 0:3 has new state: CONFIGURED_MARKEDFOREXEC
2018-06-21 11:32:55,816 : DEBUG : main : NodeContainer : : : Scatter Plot (JavaScript) 0:3 has new state: CONFIGURED_QUEUED
2018-06-21 11:32:55,816 : DEBUG : main : NodeContainer : : : JavaScriptPlot 0 has new state: EXECUTING
2018-06-21 11:32:55,816 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer : : : ROOT has new state: EXECUTING
2018-06-21 11:32:55,816 : DEBUG : KNIME-Worker-71 : WorkflowManager : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 doBeforePreExecution
2018-06-21 11:32:55,816 : DEBUG : KNIME-Worker-71 : NodeContainer : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 has new state: PREEXECUTE
2018-06-21 11:32:55,816 : DEBUG : KNIME-Worker-71 : WorkflowManager : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 doBeforeExecution
2018-06-21 11:32:55,816 : DEBUG : KNIME-Worker-71 : NodeContainer : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 has new state: EXECUTING
2018-06-21 11:32:55,817 : DEBUG : KNIME-Worker-71 : WorkflowFileStoreHandlerRepository : Scatter Plot (JavaScript) : 0:3 : Adding handler 5b1e4b05-c2cf-4c7d-9dcd-76350f22a371 (Scatter Plot (JavaScript) 0:3: ) - 3 in total
2018-06-21 11:32:55,817 : DEBUG : KNIME-Worker-71 : LocalNodeExecutionJob : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 Start execute
2018-06-21 11:32:55,817 : DEBUG : KNIME-Worker-71 : Node : Scatter Plot (JavaScript) : 0:3 : reset
2018-06-21 11:32:55,817 : ERROR : KNIME-Worker-71 : Node : Scatter Plot (JavaScript) : 0:3 : Execute failed: org/knime/ext/phantomjs/PhantomJSImageGenerator
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : Node : Scatter Plot (JavaScript) : 0:3 : Execute failed: org/knime/ext/phantomjs/PhantomJSImageGenerator
java.lang.NoClassDefFoundError: org/knime/ext/phantomjs/PhantomJSImageGenerator
at org.knime.js.core.node.AbstractImageWizardNodeModel.renderViewAndCreateImage(AbstractImageWizardNodeModel.java:132)
at org.knime.js.core.node.AbstractImageWizardNodeModel.performExecute(AbstractImageWizardNodeModel.java:100)
at org.knime.js.core.node.AbstractWizardNodeModel.execute(AbstractWizardNodeModel.java:133)
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)
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : WorkflowManager : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 doBeforePostExecution
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : NodeContainer : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 has new state: POSTEXECUTE
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : WorkflowManager : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 doAfterExecute - failure
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : Node : Scatter Plot (JavaScript) : 0:3 : reset
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : Node : Scatter Plot (JavaScript) : 0:3 : clean output ports.
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : WorkflowFileStoreHandlerRepository : Scatter Plot (JavaScript) : 0:3 : Removing handler 5b1e4b05-c2cf-4c7d-9dcd-76350f22a371 (Scatter Plot (JavaScript) 0:3: ) - 2 remaining
2018-06-21 11:32:55,818 : DEBUG : KNIME-Worker-71 : NodeContainer : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 has new state: IDLE
2018-06-21 11:32:55,819 : DEBUG : KNIME-Worker-71 : Node : Scatter Plot (JavaScript) : 0:3 : Configure succeeded. (Scatter Plot (JavaScript))
2018-06-21 11:32:55,819 : DEBUG : KNIME-Worker-71 : NodeContainer : Scatter Plot (JavaScript) : 0:3 : Scatter Plot (JavaScript) 0:3 has new state: CONFIGURED
2018-06-21 11:32:55,819 : DEBUG : KNIME-Worker-71 : NodeContainer : Scatter Plot (JavaScript) : 0:3 : JavaScriptPlot 0 has new state: CONFIGURED
2018-06-21 11:32:55,819 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer : : : ROOT has new state: IDLE

I’ve tried the same plotting on machines with several Operating Systems, like CentOS6, CentOS7 and Ubuntu 16.04. However, all the trials on Linux resulted in failure with the same error. On the other hand, this phenomenon cannot be observed on Mac OS (Sierra).

By checking the community log, I found the information that turning-off the “Create image at outport” would work, and it really works. However, it would be much better to be able to get images on Linux machines, too.

Many thanks for your help, in advance.

Hi @Koji_Oda,

My suggestion would be to switch to KNIME 3.6 if you’re still using a previous version and switch to the “Bundled Chromium Browser” option for JavaScript Views in your KNIME preferences (Preferences -> KNIME -> JavaScript Views):

Best,
Anna

2 Likes

Hi, @amartin,

Thank you very much for your suggestion.

I could find the same preference page on KNIME 3.6.0 which runs on CentOS 7 (not on CentOS 6, but it does not matter because I understand that the latest version of Chromium is not available for CentOS 6).

However, it still doesn’t work on CentOS 7…

2018-08-09 18:18:49,149 : DEBUG : KNIME-Worker-3 : Buffer : Scatter Plot (JavaScript) : 0:2 : Opening input stream on file “/tmp/knime_test62202/knime_container_20180809_5582197721124951456.tmp”, 0 open streams
2018-08-09 18:18:49,151 : DEBUG : KNIME-Worker-3 : Buffer : Scatter Plot (JavaScript) : 0:2 : Closing input stream on “/tmp/knime_test62202/knime_container_20180809_5582197721124951456.tmp”, 0 remaining
2018-08-09 18:18:49,382 : INFO : KNIME-Worker-3 : JavaScriptViewCreator : Scatter Plot (JavaScript) : 0:2 : JavaScript view - Scatter Plot - created. Debug output at: /tmp/knimeViewContainer62205/debug_15338063293821734857498845056612.html
2018-08-09 18:18:49,384 : DEBUG : KNIME-Worker-3 : ChromeViewService : Scatter Plot (JavaScript) : 0:2 : Acquiring Chromium image generation instance (9 left available of 10).
2018-08-09 18:19:09,397 : ERROR : KNIME-Worker-3 : ChromeImageGenerator : Scatter Plot (JavaScript) : 0:2 : Could not initialize Chrome driver. Timed out waiting for driver server to start.
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T15:15:03.216Z’
System info: host: ‘(hostname)’, ip: ‘(ip address)’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.10.0-693.el7.x86_64’, java.version: ‘1.8.0_152’
Driver info: driver.version: ChromeDriver
2018-08-09 18:19:09,397 : DEBUG : KNIME-Worker-3 : ChromeImageGenerator : Scatter Plot (JavaScript) : 0:2 : Could not initialize Chrome driver. Timed out waiting for driver server to start.

FirewallD is not running on this machine.
I would appreciate if I could get further assistance on this problem.

Best regards,
Koji

Hi @Koji_Oda,

Please go to your KNIME installation folder, more precisely at something similar (I am using MacOS) to /Eclipse/plugins/org.knime.ext.chromium.bin.macosx.x86_64_67.0.3396.v201806150845/macosx/x86_64

where you should find a Chromium executable. Please try to run it from console and see what the error messages will be, probably some dependent libraries are missing.

Best,
Anna

1 Like

Hi, @amartin,

Thank you for your comment.

In my case, the following command successfully works

$ /home/knime/knime_3.6.0/plugins/org.knime.ext.chromium.bin.linux.x86_64_67.0.3396.v201806062304/linux/x86_64/chrome --no-sandbox

and I can do web-browsing by using the chrome. However, there still remains the same problem of “Error retrieving image: Chrome driver was not initialized.”

I am afraid I need further help. Thank you for your assistance in advance.

Sincerely,
Koji

Hi @Koji_Oda,

Could you please try to run the following command in your console:

/home/knime/knime_3.6.0/plugins/org.knime.ext.chromium.bin.linux.x86_64_67.0.3396.v201806062304/linux/x86_64/chrome --allow-file-access --allow-file-access-from-files --headless --user-data-dir=$EMPTY_FOLDER$ --profile-directory=Default --no-sandbox

where $EMPTY_FOLDER$ is the pass to any empty folder,

and see what kind of error message you will get.

Best,
Anna

Hi @amartin ,

Thank you very much for your continuous support.

I’ve tried

$ /home/knime/knime_3.6.0/plugins/org.knime.ext.chromium.bin.linux.x86_64_67.0.3396.v201806062304/linux/x86_64/chrome --allow-file-access --allow-file-access-from-files --headless --user-data-dir=/tmp/empty/ --profile-directory=Default --no-sandbox
Fontconfig warning: “/etc/fonts/fonts.conf”, line 146: blank doesn’t take any effect anymore. please remove it from your fonts.conf
[0823/090743.236345:ERROR:gpu_process_transport_factory.cc(1016)] Lost UI shared context.

The warning on Fontconfig was fixed by editing /etc/fonts/fonts.conf but the error message on gpu_process_transport_factory.cc still remains.

I’ve tried the same command without ‘–headless’, then I’ve got the following messages:

$ /home/knime/knime_3.6.0/plugins/org.knime.ext.chromium.bin.linux.x86_64_67.0.3396.v201806062304/linux/x86_64/chrome --allow-file-access --allow-file-access-from-files --user-data-dir=/tmp/empty/ --profile-directory=Default --no-sandbox
LaunchProcess: failed to execvp:
/home/knime/knime_3.6.0/plugins/org.knime.ext.chromium.bin.linux.x86_64_67.0.3396.v201806062304/linux/x86_64/nacl_helper
[111893:111893:0823/092712.607044:ERROR:nacl_fork_delegate_linux.cc(314)] Bad NaCl helper startup ack (0 bytes)
ATTENTION: default value of option force_s3tc_enable overridden by environment.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[111891:111952:0823/092713.473511:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are “tcp” and on UNIX “unix”)
[111891:111891:0823/092713.756378:ERROR:gpu_process_transport_factory.cc(1016)] Lost UI shared context.
[111956:111972:0823/092713.913655:ERROR:command_buffer_proxy_impl.cc(132)] ContextResult::kTransientFailure: Failed to send > GpuChannelMsg_CreateCommandBuffer.

It still reports several errors, but I can use Chromium browser.

On the Chromium driver, I would like to add the following error messages from KNIME:

(KNIME:115389): Gtk-WARNING **: Allocating size to GtkBox 0x7f972422ff80 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
Starting ChromeDriver 2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7) on port 3619
Only local connections are allowed.
[1534986728.627][SEVERE]: bind() returned an error, errno=99: Cannot assign requested address (99)
WARN KNIME-Worker-1 NewReleaseMessageInjector Could not modify intro page: update.knime.com
WARN KNIME-Worker-2 TipsAndNewsInjector Could not modify intro page: www.knime.com
ERROR KNIME-Worker-0 ChromeImageGenerator Could not initialize Chrome driver. Timed out waiting for driver server to start.
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T15:15:03.216Z’

By checking processes, I’ve found that chromedriver itself have been successfully launched from KNIME after using “ScatterPlot (JavaScript)”:

$ ps -aef |grep chrome
oda 115550 115389 0 10:12 pts/8 00:00:00 /home/knime/knime_3.6.0/plugins/org.knime.ext.seleniumdrivers.multios.bin.linux.x86_64_2.40.0.v201806120734/linux/x86_64/chromedriver --port=3619

$ netstat -anp |grep chro
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:3619 0.0.0.0:* LISTEN 115550/chromedriver
unix 2 DGRAM 28096521 - /var/run/chrony/chronyd.sock
unix 3 STREAM CONNECTED 62969427 115550/chromedriver
unix 3 STREAM CONNECTED 62969428 115550/chromedriver
unix 3 STREAM CONNECTED 62977926 115550/chromedriver
unix 3 STREAM CONNECTED 62977927 115550/chromedriver

I would appreciate for your further help.

Best,
Koji

Hi Koji,

can you try adding the --disable-gpu command line switch to the KNIME preferences (or try starting the headless Chromium with that option added)? On Windows we set this option as well for the headless mode as there seems to be a couple of open bugs on the Chromium project regarding this.
See for example https://bugs.chromium.org/p/chromium/issues/detail?id=737678.