# R nodes hang

**URL:** <https://forum.knime.com/t/r-nodes-hang/13362>\
**Category:** KNIME Extensions\
**Tags:** scripting\
**Created:** [February 2, 2019, 2:44pm UTC](https://forum.knime.com/t/r-nodes-hang/13362 "2019-02-02T14:44:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elisabet\_T](https://forum-cdn.knime.com/user_avatar/forum.knime.com/elisabet_t/32/17953_2.png) [@Elisabet\_T](https://forum.knime.com/u/Elisabet_T)\
**Post date:** [February 2, 2019, 2:44pm UTC](https://forum.knime.com/t/r-nodes-hang/13362/1 "2019-02-02T14:44:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 2, 2019, 3:24pm UTC](https://forum.knime.com/t/r-nodes-hang/13362/2 "2019-02-02T15:24:12Z")

</div>

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:

> [@Install R alongside KNIME on Windows and MacOS](https://forum.knime.com/t/install-r-alongside-knime-on-windows-and-macos/13287):
>
> Over the last months I have collected a few entries about the installation of [R](https://www.r-project.org) alongside KNIME that contain some maybe useful hints how to overcome certain obstacles while installing them. I want to bring them together here. (If you are looking for a basic guide about how to install R in the first place you might look [here](https://medium.com/@GalarnykMichael/install-r-and-rstudio-on-windows-5f503f708027) or [here](https://www.dummies.com/programming/r/how-to-install-r/)). A few maybe unnecessary remarks upfront. Yes it takes some effort to get KNIME and R up and running but in the end you will be rewarded with the whole world of pos…

---

<div class="post-metadata">

**Author:** ![Elisabet\_T](https://forum-cdn.knime.com/user_avatar/forum.knime.com/elisabet_t/32/17953_2.png) [@Elisabet\_T](https://forum.knime.com/u/Elisabet_T)\
**Post date:** [February 2, 2019, 10:17pm UTC](https://forum.knime.com/t/r-nodes-hang/13362/3 "2019-02-02T22:17:49Z")

</div>

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](https://www.rforge.net/src/contrib/Rserve_1.8-6.tar.gz).
- Install Rtools.
- Be sure that you have as [environmental variables](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) 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 🙂

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…

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 3, 2019, 7:58pm UTC](https://forum.knime.com/t/r-nodes-hang/13362/4 "2019-02-03T19:58:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Elisabet\_T](https://forum-cdn.knime.com/user_avatar/forum.knime.com/elisabet_t/32/17953_2.png) [@Elisabet\_T](https://forum.knime.com/u/Elisabet_T)\
**Post date:** [February 4, 2019, 9:56am UTC](https://forum.knime.com/t/r-nodes-hang/13362/5 "2019-02-04T09:56:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 4, 2019, 6:49pm UTC](https://forum.knime.com/t/r-nodes-hang/13362/6 "2019-02-04T18:49:35Z")

</div>

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.

> **[Table to R — NodePit](https://nodepit.com/node/org.knime.r.TableToRNodeFactory)**
>
> Converts a KNIME data table into an R object.

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.

---

<div class="post-metadata">

**Author:** ![Mark\_Ortmann](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@Mark\_Ortmann](https://forum.knime.com/u/Mark_Ortmann)\
**Post date:** [March 28, 2019, 2:27pm UTC](https://forum.knime.com/t/r-nodes-hang/13362/7 "2019-03-28T14:27:29Z")

</div>

@Elisabet_T,

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

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 2, 2023, 9:29pm UTC](https://forum.knime.com/t/r-nodes-hang/13362/8 "2023-06-02T21:29:05Z")

</div>

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