Per user execution fails with RMI error - org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]

Knime server functioning normally in standard execution mode fails in per-user execution mode with RMI error that shows:

!SESSION 2019-02-13 08:53:24.228 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_191
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2019-02-13 08:53:25.145
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
        at org.eclipse.swt.SWT.error(SWT.java:4559)
        at org.eclipse.swt.widgets.Display.createDisplay(Display.java:955)
        at org.eclipse.swt.widgets.Display.create(Display.java:942)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:174)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:566)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:557)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:781)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:160)
        at org.knime.product.rcp.KNIMEApplication.createDisplay(KNIMEApplication.java:200)
        at org.knime.product.rcp.KNIMEApplication.start(KNIMEApplication.java:103)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

In the RMI log…in the tomcat localhost log I see:

13-Feb-2019 10:24:07.724 WARNING [KNIME-RMI-syserr-<xxxxxxx>-50101] com.knime.enterprise.server.executor.rmi.ProcessOutputConsumer.logOutput Knime: Cannot open display: 
13-Feb-2019 10:24:09.122 WARNING [KNIME-RMI-syserr-<xxxxxxx>-50101] com.knime.enterprise.server.executor.rmi.ProcessOutputConsumer.logOutput Knime:
13-Feb-2019 10:24:09.122 WARNING [KNIME-RMI-syserr-<xxxxxxx>-50101] com.knime.enterprise.server.executor.rmi.ProcessOutputConsumer.logOutput An error has occurred. See the log file
13-Feb-2019 10:24:09.122 WARNING [KNIME-RMI-syserr-<xxxxxxx>-50101] com.knime.enterprise.server.executor.rmi.ProcessOutputConsumer.logOutput /ddn/gs1/home/xxxxxxx/.eclipse/1504701571_linux_gtk_x86_64/configuration/1550071447794.log.
13-Feb-2019 10:24:09.504 WARNING [http-nio-8080-exec-7] com.knime.enterprise.server.executor.rmi.RMIExecutorImpl.startSlave The RMI process terminated unexpectedly with exit code 13
13-Feb-2019 10:24:09.504 SEVERE [http-nio-8080-exec-7] com.knime.enterprise.server.executor.rmi.RMIExecutorImpl.reportStartupError RMI executor could not be started. Command executed:
/usr/bin/sudo -u xxxxxxx /opt/knime/knime_server/knime_executor/knime --launcher.suppressErrors --launcher.ini /opt/knime/knime_server/workflow_repository/runtime/runtime_knime-rmi_xxxxxxx-50101/knime-rmi.ini
Last 4 lines of log output follow:
	Knime: Cannot open display: 
	Knime:
	An error has occurred. See the log file
	/ddn/gs1/home/xxxxxxx/.eclipse/1504701571_linux_gtk_x86_64/configuration/1550071447794.log.
Also check log file in /opt/knime/knime_server/knime_executor/configuration
13-Feb-2019 10:24:09.505 SEVERE [http-nio-8080-exec-7] com.knime.enterprise.webportal.components.wkfpanels.WorkflowJobInputFirstPagePanel.attach Failed to load quick form input: RMI executor could not be started, see log file for details
 com.knime.enterprise.utility.ExecutorException: RMI executor could not be started, see log file for details
	at com.knime.enterprise.server.executor.rmi.RMIExecutorImpl.reportStartupError(RMIExecutorImpl.java:420)
	at com.knime.enterprise.server.executor.rmi.RMIExecutorImpl.startSlave(RMIExecutorImpl.java:364)
	at com.knime.enterprise.server.executor.rmi.RMIExecutorImpl.<init>(RMIExecutorImpl.java:224)
	at com.knime.enterprise.server.executor.rmi.RMIExecutorManagerImpl.startNewRMI(RMIExecutorManagerImpl.java:307)
	at com.knime.enterprise.server.executor.rmi.RMIExecutorManagerImpl.getExecutorInstance(RMIExecutorManagerImpl.java:384)
	at com.knime.enterprise.server.executor.rmi.RMIExecutorManagerImpl.getExecutorInstance(RMIExecutorManagerImpl.java:63)
	at com.knime.enterprise.webportal.presenters.ExecutionHandler.checkExecutor(ExecutionHandler.java:167)
	at com.knime.enterprise.webportal.presenters.ExecutionHandler.<init>(ExecutionHandler.java:129)

If I just remove this:

com.knime.server.executor.sudo_cmd=/usr/bin/sudo

It goes back into the standard exec mode and works fine (under the knime user)

I tried various things like setting DISPLAY in the environment of this xxxx target user and turning on X11 Forwarding, etc. I have ended up pretty stumped. Anyone else seen this? It might be some X11 Fu that is beyond my skill set.

Can you post the contents of the above file? It should contain two lines

-application
com.knime.enterprise.slave.KNIME_REMOTE_APPLICATION

However in your case the wrong application (the UI) is started. Hence the X11 problems.

Hi thor,
Here’s what’s in the file…

--launcher.GTK_version
2
-user
@none
-data
/opt/knime/knime_server/workflow_repository/runtime/runtime_knime-rmi_xxxxxx-50101
-nosplash
-application
com.knime.enterprise.slave.KNIME_REMOTE_APPLICATION
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.551.v20171108-1834
-vm
plugins/org.knime.binary.jre.linux.x86_64_1.8.0.152-01/jre/bin
-vmargs
-server
-Dsun.java2d.d3d=false
-Dosgi.classloader.lock=classname
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-Dsun.net.client.defaultReadTimeout=0
-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot
-Xmx46G
-Dorg.eclipse.swt.internal.gtk.disablePrinting
-Duser.home=/opt/knime/knime_server/workflow_repository/runtime/runtime_knime-rmi_xxxxxx-50101
-Dcom.knime.server.executor.start_port=50101
-Dknime.disable.vmfilelock=true
-Djava.awt.headless=true


This looks correct. What happens if you execute the complete sudo command line manually as the user running the server process?

as knime user (centos7)

-bash-4.2$ whoami

knime

-bash-4.2$ /usr/bin/sudo -u xxxxxxx /opt/knime/knime_server/knime_executor/knime --launcher.suppressErrors --launcher.ini /opt/knime/knime_server/workflow_repository/runtime/runtime_knime-rmi_xxxxxx-50101/knime-rmi.ini

Knime: Cannot open display: 

Knime:

An error has occurred. See the log file

/ddn/gs1/home/xxxxx/.eclipse/1504701571_linux_gtk_x86_64/configuration/1550168755390.log.

-bash-4.2$


dumping the log referred to above…


!SESSION 2019-02-14 13:25:55.267 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_191
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2019-02-14 13:25:56.356
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
        at org.eclipse.swt.SWT.error(SWT.java:4559)
        at org.eclipse.swt.widgets.Display.createDisplay(Display.java:955)
        at org.eclipse.swt.widgets.Display.create(Display.java:942)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:174)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:566)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:557)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:781)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:160)
        at org.knime.product.rcp.KNIMEApplication.createDisplay(KNIMEApplication.java:200)
        at org.knime.product.rcp.KNIMEApplication.start(KNIMEApplication.java:103)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
/ddn/gs1/home/xxxxx/.eclipse/1504701571_linux_gtk_x86_64/configuration/1550168755390.log (END)


I thought I’d share that ‘knime’ is an executable here, which looks like it’s the Eclipse app? That seems wrong!:

-bash-4.2$ pwd
/opt/knime/knime_server/knime_executor
-bash-4.2$ ls -la
total 10812
drwxr-xr-x   8 knime knime     310 Feb 14 13:30 .
drwxr-xr-x   6 knime knime     162 Feb  4 10:28 ..
-rw-r--r--   1 knime knime  371783 Jan 25 14:54 artifacts.xml
drwxr-xr-x   9 knime knime    4096 Feb 14 13:30 configuration
drwxr-xr-x   2 knime knime       6 Jan 25 14:46 dropins
drwxr-xr-x 216 knime knime   16384 Jan 25 14:53 features
-rwxr-xr-x   1 knime knime   17034 Nov  6 10:28 icon.xpm
-rwxr-xr-x   1 knime knime   71473 Nov  6 10:28 knime
-rw-r--r--   1 knime knime     519 Jan 25 14:54 knime.ini
-rw-r--r--   1 knime knime 7690956 Jul  9  2018 knime-workspace.zip
drwxr-xr-x   2 knime knime       6 Jan 25 14:54 licenses
-rw-r--r--   1 knime knime     648 Jul  9  2018 LICENSE.TXT
drwxr-xr-x   5 knime knime     119 Jan 25 14:44 p2
drwxr-xr-x 202 knime knime   81920 Jan 25 14:53 plugins
-rw-r--r--   1 knime knime  920273 Jul  9  2018 quickstart.pdf
-rw-r--r--   1 knime knime    1401 Jul  9  2018 README.txt
-rw-r--r--   1 knime knime 1839003 Jul  9  2018 ReportDesigner_Quickstart.pdf
-rwxr-xr-x   1 knime knime    3497 Jul 19  2018 update-rmi.sh

Here is the knime.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.551.v20171108-1834
-vm
plugins/org.knime.binary.jre.linux.x86_64_1.8.0.152-01/jre/bin
-vmargs
-server
-Dsun.java2d.d3d=false
-Dosgi.classloader.lock=classname
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-Dsun.net.client.defaultReadTimeout=0
-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot
-Xmx46G
-Dorg.eclipse.swt.internal.gtk.disablePrinting

as the ‘knime’ user, if I just try to ./knime and run that executable in place, I get…

-bash-4.2$ ./knime 
CompilerOracle: exclude javax/swing/text/GlyphView.getBreakSpot
Knime: Cannot open display: 
Knime: Cannot open display: 
Knime:
An error has occurred. See the log file
/opt/knime/knime_server/knime_executor/configuration/1550169332584.log.


Is the ini file readable by user xxxxx? Try sudo -u xxxxx cat /opt/knime/knime_server/workflow_repository/runtime/runtime_knime-rmi_xxxxxx-50101/knime-rmi.ini

It was not! I added my xxx user to knime group and gave knime +rwx in the workflow_repository. I think it’s past the ‘display’ issue, giving me an invalid directory which I suspect has to do with some more permissions issues.

NB we are in a machine room downtime until the beginning of next week but I think we can consider this closed and I’ll try and track down any remaining permissions issues next week. Thanks!

After our maintenance window I can bring the box up and we’re good now. It was a permissions issue and the graphics problem was a red herring. Hopefully this can help the next person, thanks for your good support work!

1 Like