KNIME : R evaluation failed.

Hi,

Need some expert advise.
After i update my KNIME from 3.5 to 3.6.1 on my macbook,
all my R note can’t be execute with error promt as below:

###############

"ERROR: Could not capture output of command.ERROR: R evaluation failed.: "knime.stdout.con<-textConnection(‘knime.stdout’,‘w’);knime.stderr.con<-textConnection(‘knime.stderr’,‘w’);sink(knime.stdout.con);sink(knime.stderr.con,type=‘message’)"ERROR: R evaluation failed.: "knime.stdout.con<-textConnection(‘knime.stdout’,‘w’);knime.stderr.con<-textConnection(‘knime.stderr’,‘w’);sink(knime.stdout.con);sink(knime.stderr.con,type=‘message’)"ERROR: voidEval failedERROR: Transferring the R script to R failed.ERROR: R evaluation failed.: "knime.tmp.script"ERROR: assign failedERROR: Could not capture output of command.ERROR: R evaluation failed.: "sink();sink(type=‘message’)
close(knime.stdout.con);close(knime.stderr.con)
knime.output.ret<-c(paste(knime.stdout,collapse=’\n’), paste(knime.stderr,collapse=’\n’))
knime.output.ret"ERROR: R evaluation failed.: "sink();sink(type=‘message’)
close(knime.stdout.con);close(knime.stderr.con)
knime.output.ret<-c(paste(knime.stdout,collapse=’\n’), paste(knime.stderr,collapse=’\n’))
knime.output.ret"ERROR: eval failedERROR: Could not cleanup after command execution.ERROR: R evaluation failed.: "rm(knime.tmp.ret,knime.output.ret,knime.stdout.con,knime.stderr.con,knime.stdout,knime.stderr)"ERROR: R evaluation failed.: "rm(knime.tmp.ret,knime.output.ret,knime.stdout.con,knime.stderr.con,knime.stdout,knime.stderr)"ERROR: voidEval failedERROR: Could not execute internal command.ERROR: R evaluation failed.: "dev.off()"ERROR: R evaluation failed.: "dev.off()"ERROR: eval failedERROR: Could not execute internal command.ERROR: R evaluation failed.: "ls()"ERROR: R evaluation failed.: "ls()“ERROR: eval failed”

################

Could you check if you have the most recent version of RServe installed?

My Rserve version : 1.7-3

You will have to upgrade to the latest version of RServe which should be 1.8.6 as it fixes issues with KNIME and R on a Mac. You will have to do it via separate command not via the usual update process:

install.packages(‘Rserve’,“http://rforge.net/",type="source”)

there error with running this code:
install.packages(‘Rserve’,“http://rforge.net/",type="source”)

###############
Would you like to use a personal library instead? (yes/No/cancel) yes
trying URL ‘http://cran.rstudio.com/src/contrib/Rserve_1.7-3.tar.gz
Content type ‘application/x-gzip’ length 407390 bytes (397 KB)

downloaded 397 KB

  • installing source package ‘Rserve’ …
    ** package ‘Rserve’ successfully unpacked and MD5 sums checked
    checking whether to compile the server… yes
    configure: error: R was configured without --enable-R-shlib or --enable-R-static-lib

*** Rserve requires R (shared or static) library. ***
*** Please install R library or compile R with either --enable-R-shlib ***
*** or --enable-R-static-lib support ***

Alternatively use --without-server if you wish to build only Rserve client.

ERROR: configuration failed for package ‘Rserve’

  • removing ‘/Users/ephuach/Library/R/3.5/library/Rserve’
    Warning in install.packages :
    installation of package ‘Rserve’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/y9/_pvs3v4554x0wdmv4qwxxwpm0000gn/T/Rtmp7QHbQF/downloaded_packages’

Depending upon your version of MacOS you might have to install additional tools in order to compile R packages from source code:

https://cran.r-project.org/bin/macosx/tools/

The error message seems to suggest it is trying to install version 1.7-3. You might have to download the newest source ( Rserve_1.8-6.tar.gz) manually from here:

https://www.rforge.net/Rserve/files/

Hi mlauber71,

Still not able to install after install additional tools for mac, follow by install from downloads file.
image

You could try the .gz file not the .tar file.
And you could set the Timezone before installing. I do not think it is the problem but there were issues with that in the past.

Still not success…

Things I can think of trying:

  • reinstall the latest version of R (3.5.1) again
  • use RStudio to try and install the RServe package
  • either try it via the original command or by pointing RStudio to the path where you downloaded the tar.gz file

This message of non zero exit is a dread, I am sorry. I was able to overcome it several times by trying different approaches until success. Not very convenient I know.

After you have checked all that you might want to check the paths of your R libraries with

.libPaths()

I found on my macOS system that R somehow uses two different library paths. My understanding is it first uses the path mentioned first, but this might lead to unwanted side effects. You could try consolidating the libraries (though I am no expert in that) or specifically mentioning which libray to use with the comand (eg.)

library(“h2o”, lib.loc = “/Users/m_lauber/Library/R/3.5/library/”)

Do you use the “KNIME R Scripting extension”? If so, it might help to uninstall that extension and use the “KNIME R Statistics Integration” instead.

And another thing. If you have to use the newest version of RServe you will have to compile the package. On MacOS you will need the packages mentioned on the relevant R website:

https://cran.r-project.org/bin/macosx/

On a windows system you will have to compile the package with the help of RTools
https://cran.r-project.org/bin/windows/base/rw-FAQ.html#Can-I-install-packages-into-libraries-in-this-version_003f

I recently noted that at least when compiling the RServe package Rtools does not like to sit in a directory with blanks in the path name, so better have it at a place like

c:\rtools

rather then:
c\my programs\my little r collection\R-Tools