Getting Knime running on an Amazon EC2 instance

I am going through the hoops to install 4.2 on an Amazon Linux instance (Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type - with preloaded The default image includes AWS command line tools, Python, Ruby, Perl, and Java. The repositories include Docker, PHP, MySQL, PostgreSQL, and other packages.)

Of course, I have been yum-ing installs for several hours. Through a vnc connect into an installed vnc server, xterm session, etc., I get this error in the knime configuration logfile:

!SESSION 2020-08-05 00:15:09.970 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_252
java.vendor=AdoptOpenJDK
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 2020-08-05 00:15:11.452
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-pi4-gtk-4932r18 in java.library.path
no swt-pi4-gtk in java.library.path
Can’t load library: /home/knime/.swt/lib/linux/x86_64/libswt-pi4-gtk-4932r18.so
Can’t load library: /home/knime/.swt/lib/linux/x86_64/libswt-pi4-gtk.so

    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:342)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:256)
    at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:90)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155)
    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:164)
    at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:760)
    at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:166)
    at org.knime.product.rcp.KNIMEApplication.createDisplay(KNIMEApplication.java:215)
    at org.knime.product.rcp.KNIMEApplication.start(KNIMEApplication.java:107)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    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:657)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

Can you please give insight into what additional yum package(s) I may need to install. They may not be present in the default repos, so if you have a suggested repo location for the packages, that would be wonderful.

I can’t imagine I am the first person to be doing this :slight_smile:

Hi @smuskal,

We got it working on CentOS 7 (in headless mode) with the following packages installed:

yum update -y \
    && yum install -y epel-release \
    && yum install -y --setopt=install_weak_deps=False \
        gtk3 \
        java-devel \
        libgomp \
        libXtst \
        xorg-x11-server-Xvfb \
    && yum clean all

I don’t know, if all of them are available also for Amazon Linux, maybe just give it a try. The error message sounds quite familiar to me: I think gtk3 and libXtst should solve the issue.

Edit: I see some OSSes only provide gtk4. At least for newer Ubuntu versions, we use gtk4 (libswt-gtk-4-jni and libswt-gtk-4-java) instead. So take this post as a hint and watch out for similar packages in Amazon Linux :slight_smile:

Best regards,
Daniel

3 Likes

Thanks for responding Daniel. The Knime community is awesome.

Unfortunately, the suggested yum doesn’t get me there.

Loaded plugins: priorities, update-motd, upgrade-helper

35 packages excluded due to repository priority protections

No packages marked for update

Loaded plugins: priorities, update-motd, upgrade-helper

35 packages excluded due to repository priority protections

Package epel-release-6-8.9.amzn1.noarch already installed and latest version

Nothing to do

Loaded plugins: priorities, update-motd, upgrade-helper

Main config did not have a install_weak_deps attr. before setopt

35 packages excluded due to repository priority protections

No package gtk3 available.

Package 1:java-1.8.0-openjdk-devel-1.8.0.252.b09-2.51.amzn1.x86_64 already installed and latest version

Package libgomp-6.4.1-1.45.amzn1.x86_64 already installed and latest version

Package libXtst-1.2.2-2.1.9.amzn1.x86_64 already installed and latest version

Package xorg-x11-server-Xvfb-1.15.0-26.41.amzn1.x86_64 already installed and latest version

Nothing to do

Loaded plugins: priorities, update-motd, upgrade-helper

Cleaning repos: amzn-main amzn-updates nux-dextop

Cleaning up everything

I also explored the libswt-gtk-4-jni, et al. with no luck. Very frustrating, I working on a new rabbit hole trying to build WebKitGTK via this: https://trac.webkit.org/wiki/BuildingGtk but it seems every step requires more perl installs. There has to be an easier way!!!

-Steve

I am sorry that did not help for Amazon Linux! It also took us quite some time to get everything up and running with different CentOS and Ubuntu versions.

I am afraid – unless somebody chimes in – you need to spend some time on Google and install potential packages unless you “accidentally” pick the right one. That sounds so familiar to me… :man_facepalming:

Well, I recreated a whole new instance using Ubuntu. After now apt-ing for about as long as I previously yum’d, I know get this error trying to launch Knime. Any suggestions:

SESSION 2020-08-08 19:46:49.496 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_252
java.vendor=AdoptOpenJDK
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Command-line arguments: -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2020-08-08 19:46:58.296
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4749)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:1130)
at org.eclipse.swt.widgets.Display.create(Display.java:1070)
at org.eclipse.swt.graphics.Device.(Device.java:175)
at org.eclipse.swt.widgets.Display.(Display.java:636)
at org.eclipse.swt.widgets.Display.(Display.java:627)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:776)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:166)
at org.knime.product.rcp.KNIMEApplication.createDisplay(KNIMEApplication.java:215)
at org.knime.product.rcp.KNIMEApplication.start(KNIMEApplication.java:107)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
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:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

Really, it is amazing how difficult this has been.

I think this is a permissions problem somewhere, but I finally achieved a knime launch as root!

1 Like

Hi , Thanks it got worked for me … :+1:

1 Like