Path to R Home failed

I’ve an error with the integration of R into knime. I’ve got this message into the preference:

/usr/lib/R contains an invalid R executable!

And i also this message into the console from the R source (Table) node

R cannot be initialized.
Cannot determine major version of R. Please check the R installation defined in the KNIME preferences.

My system: Ubuntu 18.04
Knime Analytics Platform: 4.0

@Cedunia,

I’m not able to reproduce that problem.
Can you give me some additional information?

Could you start R and run the following commands

system("type R")
R.home()
file.path(R.home("bin"), "R")

from your console

ls -l /usr/lib/R/bin/R

Have you made any changes to your R installation lately, e.g., version update? Do you use RStudio?

Best
Mark

1 Like

Here is the result of the commands:

system(“type R”)
R is /usr/bin/R
R.home()
[1] “/usr/lib/R”
file.path(R.home(“bin”), “R”)
[1] “/usr/lib/R/bin/R”

and the output from console:

ls -l /usr/lib/R/bin/R
-rwxr-xr-x 1 root root 8812 mai 13 02:53 /usr/lib/R/bin/R

I use the last version of R version 3.6.0 (2019-04-26) and the last version of RStudio Version 1.2.1335.

Thank you for your help

@Cedunia,

thanks. Everything seems fine there. Could you please send me the output of the following commands.

Start

library(“Rserve”)
sessionInfo()

here is the output

library(“Rserve”)
sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

locale:
[1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C
[3] LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8
[5] LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8
[7] LC_PAPER=fr_FR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] Rserve_1.7-3.1

loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 crayon_1.3.4 dplyr_0.8.3 assertthat_0.2.1
[5] grid_3.6.0 R6_2.4.0 gtable_0.3.0 magrittr_1.5
[9] scales_1.0.0 platetools_0.1.2 ggplot2_3.2.0 pillar_1.4.2
[13] rlang_0.4.0 lazyeval_0.2.2 RColorBrewer_1.1-2 tools_3.6.0
[17] glue_1.3.1 purrr_0.3.2 munsell_0.5.0 compiler_3.6.0
[21] pkgconfig_2.0.2 colorspace_1.4-1 tidyselect_0.2.5 tibble_2.1.3

Thx. Will have to do some more digging :). Very likely, that it will take some time, sry for the inconvenience.

Hi @Cedunia,

You need to install Rserve_1.8-6, there are some bugs with the earlier version you have installed see the following post for how to do this:

I had to install R-develop and openssl-devel packages on my system to make that work.

However, that should not have caused your problem. Did you try with a freshly downloaded KNIME AP with a new Workspace? Maybe something went wrong with the installation.
best,
Gabriel

Hello @gab1one,

With a new freshly Knime AP and new worksape i have

ERROR RBinUtil Error reading error output of external R process.

Thanks for your help

Hi @Cedunia,

can you please post the content of the KNIME Log just before this error? It should contain additional information about the error. You need to set the Log File Log Level to debug first, which you can do in the KNIME preference page.

best,
Gabriel

Here the output of the log:

2019-07-15 14:21:01,872 : DEBUG : R Error Reader : : RBinUtil : : : External Rscript process error output: Rscript execution error: No such file or directory
2019-07-15 14:21:01,872 : DEBUG : R Output Reader : : RBinUtil : : : External Rscript process output:
2019-07-15 14:21:01,875 : DEBUG : R Error Reader : : RBinUtil : : : External Rscript process error output: Rscript execution error: No such file or directory
2019-07-15 14:21:01,875 : DEBUG : R Output Reader : : RBinUtil : : : External Rscript process output:
2019-07-15 14:21:05,687 : DEBUG : R Error Reader : : RBinUtil : : : External Rscript process error output: Rscript execution error: No such file or directory
2019-07-15 14:21:05,687 : DEBUG : R Output Reader : : RBinUtil : : : External Rscript process output:
2019-07-15 14:21:13,456 : DEBUG : R Error Reader : : RBinUtil : : : External Rscript process error output: Rscript execution error: No such file or directory
2019-07-15 14:21:13,456 : DEBUG : R Output Reader : : RBinUtil : : : External Rscript process output:
2019-07-15 14:21:13,459 : DEBUG : R Error Reader : : RBinUtil : : : External Rscript process error output: Rscript execution error: No such file or directory
2019-07-15 14:21:13,459 : DEBUG : R Output Reader : : RBinUtil : : : External Rscript process output:
2019-07-15 14:21:15,277 : DEBUG : KNIME-ConfigurationArea-Checker : : ConfigurationAreaChecker : : : Configuration area is at /home/cedric/knime_4.0.0/configuration
2019-07-15 14:21:15,293 : DEBUG : KNIME-ConfigurationArea-Checker : : ConfigurationAreaChecker : : : Locked file in configuration area “/home/cedric/knime_4.0.0/configuration/org.knime.core/cedric.lock”
2019-07-15 14:21:15,301 : DEBUG : KNIME-ConfigurationArea-Checker : : ConfigurationAreaChecker : : : Configuration area check completed in 0,0s
2019-07-15 14:21:22,026 : DEBUG : R Output Reader : : RBinUtil : : : External Rscript process output:
2019-07-15 14:21:22,028 : ERROR : R Error Reader : : RBinUtil : : : Error reading error output of external R process.
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170)
at java.io.BufferedInputStream.read(BufferedInputStream.java:336)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at org.knime.ext.r.bin.RBinUtil.lambda$1(RBinUtil.java:209)
at java.lang.Thread.run(Thread.java:748)

Cédric

I resolve it. The bug come from the location of Rscript like suggest the log. I do this

export RHOME=$(dirname $(dirname $(which R)))

and it works !

Thanks

4 Likes

@Cedunia,

that’s good news, sorry that we didn’t come up with that.

Thanks for sharing your insights with us!

Mark

2 Likes

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