FAQ: After upgrading R in my environment, why do I see an error starting RStudio?

sujay.mahajansujay.mahajan Member, Domino Posts: 4
edited May 11 in Q&A

FAQ: After upgrading R to R3.6 in my environment, why can't I start my RStudio workspace? Why do I see this error:

`RStudio Initialization Error. Error occurred during transmission`

Answer:

As of July 2019, RStudio has a bug that causes errors if you want to use R v3.6 (bug is due to an entry in .Rprofile). The 2018 Domino base images have R v3.4, and most of the 2019 base images have R v3.5. @aaron.gruberg brought this to my attention when upgrading R to 3.6 in a Domino compute environment, and he used the version of RStudio that comes with the Base (1.1.419). It appears that this is caused due to an entry in .Rprofile that generates a null value when starting RStudio. 

When upgrading the version of R to 3.6, RStudio fails to start with this error - 

RStudio error  

How to Fix it

You need to remove this

options(error = .domino.handleError)

line from the .Rprofile. The .Rprofile we have published, works for R versions <= 3.5.x. A bug in RStudio is causing the .Rprofile we use to no longer work. Line 53 is the cause of the error. More details here - 

https://github.com/rstudio/rstudio/issues/4752

https://github.com/rstudio/rstudio/issues/4723

You can remove that line using the sed command - 

sed -i '/options(error/d' /home/ubuntu/.Rprofile

So the correct docker instructions to upgrade R to 3.6 (for Ubuntu16.04) so it works with RStudio are - 

RUN add-apt-repository 'deb http://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/' && \

apt-get update -y && \

apt-get remove r-base-core -y && \

apt-get install r-base-core=3.6.0* -y && \

sed -i '/options(error/d' /home/ubuntu/.Rprofile

## Update all R packages to be compatible with R3.6

RUN R --no-save -e 'update.packages(checkBuilt = TRUE, ask = FALSE)'

To upgrade R to 3.6 for Ubuntu 18.04 

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \

add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' && \

apt-get remove r-base-core -y && \

apt-get install r-base-core=3.6.0* -y && \

sed -i '/options(error/d' /home/ubuntu/.Rprofile

## Update all R packages to be compatible with R3.6

RUN R --no-save -e 'update.packages(checkBuilt = TRUE, ask = FALSE)'

Sign In or Register to comment.