R Problems on macOS (high sierra) since R version 3.5

I am experiencing a strange problem with R Snippets in KNIME 3.5.3 on a macOS (high sierra 10.13.4 (17E202)) system since switching to the newest R version 3.5. It seems to be there with every R Snippet I use that generates an output table, the system is not able to get back knime.out parameters and throws strange error messages. The first part using R does work so there does not seem to be a general R problem.

Well yes I tried to reinstall R, I made sure I have RServe and Cairo up and running and I also tried starting RServe separately and I tried to use every variant of R Scripting there is. And yes I also installed XQuartz …

It looks as if the KNIME R Snippets are expecting some meta variables or something that might not be there anymore with R 3.5.

I am wondering if other macOS users also have this problem or if I have to look further into my configuration.

m_008_problems_r350.knwf (35.8 KB)

I have similar issues but I just started using KNIME and was trying some tutorials.
I use macOS and installed both R and KNIME via homebrew.
I have both RServe and Cairo available.

Errors look like this:
ERROR: Could not execute internal command.ERROR: R evaluation failed.: "sapply(ls(),function(a)class(get(a,envir=globalenv()))[1])"ERROR: R evaluation failed.: "sapply(ls(),function(a)class(get(a,envir=globalenv()))[1])"ERROR: eval failed

Could you try loading all the libraries/packages you are using in those R scripts with Standalone R (not from KNIME)? Does that work or does that produce an error of some sort?

All codes are working fine with just ‘pure’ R. Also the left Node with the Replacement of NAs works fine. The moment I try to get to the result it does not work. I tried to call the library Cairo but there is no specific function in the right node, it just tries to retrieve the result (which is already there).

knime.out <- as.data.frame(rframe)
knime.out <- rframe

This does not work regardless which kind of R Snippet I use. For me it looks like something changed in R 3.5 which KNIME is relying on. It could be that it tries always to put some example PNG files in a folder and maybe R does not do that anymore.

The fact that jonasfoe has the exact same result on his macOS system leads me to the assumption that there is a more general problem.

I also attached a part of the knime.log when the right node fails. If you could have another look or maybe try to do this on a recent macOS system it would be highly appreciated.

knime_log2.docx (13.5 KB)

OK i switched from homebrew R to the package provided by CRAN and I also installed XQuartz.
Now I’m good but I cannot attest to the original problem in this thread. I think mine might have been different.

Actually, I still get the weird error messages.
It’s just that some processing seems to work in spite of it.
Sorry for the confusion.

From the changelog of R 3.5 I read

Support for a system Java on macOS has been removed — install a fairly recent
Oracle Java (see ‘R Installation and Administration’ §C.3.2).

Which is the only part which could be remotely related to this. Could you try that?

Cheers, Jonathan.

I have installed the latest version of Java for macOSX (Version 8 Update 171 (Build 1.8.0_171-b11)) but the problem is still there and I would be surprised if this is the reason because the first part of the workflow just works fine, only the part where the output should be retrieved is not working.

If just evaluating the R nodes that actually work they still produce an error message

ERROR: Could not execute internal command.ERROR: R evaluation failed.: "sapply(ls(),function(a)class(get(a,envir=globalenv()))[1])"ERROR: R evaluation failed.: "sapply(ls(),function(a)class(get(a,envir=globalenv()))[1])"ERROR: eval failed

For me this looks like something in R 3.5 changed that the R nodes of KNIME just assume would be there (some global setting, some PNG examples to be put somewhere). Some way the knime.out location gets transmitted.

Again it would be good if someone could try to reproduce the phenomenon on a macOSX machine.

And yes I know it is more likely that a stupid user does not know how to properly set up R in KNIME (and then on a Mac, oh boy …) than that there is a freak combination of changes in settings and so on. But unfortunately over the years I have encountered more and more of this occasions where I as a quite seasoned user stumbled across such freak combinations that cannot be dealt with by ‘try reboot’ :wink:

I ran into the same problem on Linux (Arch) with KNIME 3.5.3 (KNIME Interactive R Statistics Integration 3.5.1.v201712211140) and R 3.5. I manually compiled R 3.4.4 (making sure to pass --enable-R-shlib to ./configure) and changed the R home configuration in KNIME, and it worked again.

So, as suggested, this is most likely something that has changed in R 3.5 (and is not specific to macOS).

1 Like

@thor mentioned something about this problem here:

This issue was fixed in R 3.5.1 and Rserve 1.8-6.

To get that version of Rserve, you will need to install it via:
install.packages('Rserve',,"http://rforge.net/",type="source")

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.