R nodes hang

Hi,

I am using Knime since long time now. I had to install in a new computer (windows 10), Knime 3.7 and R 3.5.1 with Rserve v.1.7.3. While the same workflow works in my other computer with the same versions, in the new installation I could not make run the R nodes. They hang and I have to finally kill Knime. I have several R nodes in a loop and I run it locally.
I try to install older versions of R, because I read about the conflict of R 3.5 and Rserve, however it did not work. I also try to install Rserve 1.8.6 using Rstudio but it gives me an error:

Warning in untar2(tarfile, files, list, exdir, restore_times) :
  failed to copy 'Rserve/src/client' to 'Rserve/clients'
* installing *source* package 'Rserve' ...
Warning in system("sh ./configure.win") : 'sh' not found
ERROR: configuration failed for package 'Rserve'
* removing 'C:/Users/Guest1/Documents/R/win-library/3.5/Rserve'
* restoring previous 'C:/Users/Guest1/Documents/R/win-library/3.5/Rserve'
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
  problem copying C:\Users\Guest1\Documents\R\win-library\3.5\00LOCK-Rserve\Rserve\libs\x64\Rserve.exe to C:\Users\Guest1\Documents\R\win-library\3.5\Rserve\libs\x64\Rserve.exe: Permission denied
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘C:/Users/Guest1/Downloads/Rserve_1.8-6.tar.gz’ had non-zero exit status

I checked the Knime log and I get:

DEBUG: Service Thread: MemoryAlertSystem : : : Memory usage below threshold (85%) after GC run, currently 6% (0.17GB/2.63GB)

Any suggestions?

You can try if it works when you use this line

install.packages('Rserve',,"http://rforge.net/",type="source")

If not you have to compile a new version of Rserve (1.8.6 as of now) before you can use it. To do that you will have to install Rtools on you machine. Please refer two my entry about KNIME and R how to do that:

1 Like

Thank you for the suggestion mlauber71. I was finally able to install the last version of Rserve 1.8.6 in windows this way:

  • Download the Rserve_1.8-6.tar.gz file from here.
  • Install Rtools.
  • Be sure that you have as environmental variables in your system the path to Rtools (e.g. C:\Rtools\bin) and the path to R bin.
  • Execute the command prompt in windows
  • Go to the directory that contains the Rserve file you downloaded.
  • Type R CMD INSTALL --build Rserve_1.8-6.tar.gz
  • Rserve will be installed in your R library :slight_smile:

I also reinstall Knime, the R snippet/view are working if executed from the configuration panel. However, once I execute them in the workflow they hang…

3 Likes

Have you tried both ways of running R scripts, the R integration of KNIME itself and the community nodes (where you have to manually start Rserve first from R)? That might help us understanding what is going on.

Do the R nodes alway hang or has it something to do with large files? Have you checked if you have a 64 Bit version of R running and if you can run R alone. How much memory have you assigned to R and how much memory does your KNIME installation have?

I run R with R integration of Knime. If I want to run R with the community nodes, I suppose I have to change all the R nodes, that it is significant amount of work since I have a lot of R nodes. I guess I will try it as my last resort.

The R nodes not always hang, it could be I can execute one time the loop, but in the second iteration some of them hang. I don’t think is a problem of big files, input tables are from 4 rows to 600 rows and 6 columns.

The Knime installation has 4043m and R memory.limit is 8086 (memory.size 30.34). I have a 64 Bit version of R running.
I tried to increase Knime memory to 6043 and also to put Rserve receiving buffer to unlimited, but still not working.

I will try the option of the R community nodes.

Maybe just try to see if the community nodes do behave in a different way.

Next thing could be to try to use the experimental data.table ingestion of R.

Then I had some pretty complex R parts running in knime where I had to construct a loop that always just sends one chunk to R and later collects the results. Not very elegant but doable.

@Elisabet_T,

do only R nodes hang that are encapsulated inside a loop? Would it be possible to share your workflow with me?

1 Like