Using KNIME Server with R


#1

Hey, I'd like to use R nodes (e.g. Scripting > R > R Snippet) on a KNIME Server. When upload a workflow with an "R Snippet" node to KNIME Server and execute, it fails with message "R Snippet 2:64 - ERROR: Execute failed: R Home is invalid." Executing the workflow locally works fine.

  1. How do I set R Home when KNIME Server doesn't have a GUI where I can access preferences? Where do I have to set it?
  2. What if I don't have R installed on the server that hosts KNIME Server but on a different one? How do I tell KNIME Server to use R then?

Thanks in advance. Best regards.

Ben


#2

Hi,

Perhaps I do a mistake, but in order to use the server version you have too to use a Knime platform on your physicall server configured the very same way the one you have locally. So the problem should come from it. If you have a VPN access on your server, have a look on your R path there.


#3

Thanks for the reply, fabienc. As far as I know, KNIME Server doesn't have a graphical user interface, so I can't just look into the preferences to see the R Home path used by KNIME on the server (as I would on my local KNIME Client. I need to know where KNIME Server stores this information on the file system so I can edit it.


#4

Yes, there is one, the machine on your server is exactely the same as the one you have on your local computer there is just a TOMCAT server for Knime added on your physical server. So if you can access the Knime machine on your server it will be exactely the same as on local. Use VPN or ask your administrator.


#5

You can provide custom preferences to the executor running on the server, which also includes non-standard paths to an R installation. See the section "Preferences File" in the server administration manual (page 10). Note that R must be installed on the same computer it's not possible to use a remote R server.


#6

Ah, I get it. That sounds pretty straight forward. I'll try that.

Thanks for the quick response.


#7

Here's a brief update. I managed to configure everything in a way so that KNIME can talk to R. Maybe this helps some other people:

My preferences file /knime/server/workflow_repository/config/preferences.epf basically contains the folder with the JDBC drivers for database access and the R home directory.

#Wed Jun 14 11:05:57 CEST 2017
/instance/org.knime.workbench.core/database_drivers=/home/knime/database_drivers
/instance/org.knime.ext.r.bin/knime.r.home=/usr/lib64/microsoft-r/3.4/lib64/R
file_export_version=3.0

Rserve: Make sure to install this package directly into the library folder, i.e. the default library path of your R installation. Within R, check with .libPath() to get the path. IMPORTANT: If you use additional libPaths and install Rserve there, KNIME will NOT find it and tell you that Rserve is not installed, even if you append these additional paths in your Rprofile.site file.


#8

Hi Ben,

Thanks for confirming your setup here.

Best,

Jon


#9