Bioconductor / bioconductor_docker

Docker Containers for Bioconductor
https://bioconductor.org/help/docker/
Artistic License 2.0
73 stars 31 forks source link

Any call to `ggplot2` in the current `bioconductor_docker:devel` image makes `R`/`Rstuido` **CRASH** #27

Open r-cheologist opened 3 years ago

r-cheologist commented 3 years ago

Describe the bug With the current bioconductor_docker:devel image a call to ggplot2 out of the box crashes R/RStudio with an error like this:

29 Apr 2021 12:10:12 [rsession-rstudio] ERROR session hadabend; LOGGED FROM: rstudio::core::Error {anonymous}::rInit(const rstudio::r::session::RInitInfo&) src/cpp/session/SessionMain.cpp:680

Upon plotting, the R console freezes and crashes with above error upon entering Return.

To Reproduce Steps to reproduce the behavior:

  1. docker pull bioconductor/bioconductor_docker:devel

  2. Call

    docker run -d \
      -p 127.0.0.1:8787:8787 \
      -v /tmp:/tmp \
      -e ROOT=TRUE \
      -e DISABLE_AUTH=TRUE \
      bioconductor/bioconductor_docker:devel
  3. Use a browser and navigate to localhost:8787.

  4. In the R cosole install ggplot2 with BiocManager::install("ggplot2", update = FALSE) - UPDATING OTHER R PACKAGES DOES NOT HELP

  5. Run the following (derived from ?ggplot2::ggplot) - DO NOT SOURCE, but step through script (Shift+ Return):

    library(ggplot2)
    df <- data.frame(gp = factor(rep(letters[1:3], each = 10)), y = rnorm(30))
    ds <- do.call(rbind, lapply(split(df, df$gp), function(d) {
      data.frame(mean = mean(d$y), sd = sd(d$y), gp = d$gp)
    }))
    ggplot(df, aes(gp, y)) +
      geom_point() +
      geom_point(data = ds, aes(y = mean), colour = 'red', size = 3)

Expected behavior Plot to appear

Desktop (please complete the following information):

nturaga commented 3 years ago

I've investigated this a little. Just recording what i've found so far,

When I start up the docker image using the docker-compose file, with docker-compose up, it starts up as non-root rstudio user.

Screen Shot 2021-05-05 at 10 29 31 AM Screen Shot 2021-05-05 at 10 30 00 AM

Then, I tried your command to run as root while disabling auth. I installed ggplot2 using a binary repository I have (and not using the traditional, BiocManager::install() and compile step). This worked fine, and produced a result (as seen below). I've also attached my terminal to show how I started it up

Screen Shot 2021-05-05 at 10 37 30 AM

But when I try your command exactly, I do get the error when I do the traditional BiocManager::install(). I do get the error you are talking about,

Screen Shot 2021-05-05 at 10 44 39 AM

So the problem here could be one of two things,

  1. The ggplot2 version that is being installed

and/or

  1. Why doesn't it produce the same error when I launch the image the standard way as non-root (shown in screenshot 1) ?

I don't have the answer right now but figured my investigation to add to more debugging.

r-cheologist commented 3 years ago

Thank you for looking into this ...

The problem persists and has now become even more pressing: as the bioconductor version has rolled over, the recent bioconductor_docker:latest (not just bioconductor_docker:devel) produces the issue! Renders the otherwise great images practically useless for ggplot2-involving workflows ...

r-cheologist commented 3 years ago

BUT: the CURRENT (as 0f 2021/06/02) bioconductor_docker:devel does NOT display the behavior in my hands, so it's now a remedy to move to that.

lianos commented 3 years ago

I'm pretty sure this problem is tied to the version of RStudio that is installed in the release image. Updating the RStudio version should fix the issue:

https://github.com/rstudio/rstudio/issues/9373#issuecomment-850647249

I've had the preview release installed on the bioconductor_docker:latest image and that has been working for me, but it looks like RStudio just bumped up their "release" download now to include the fix:

https://www.rstudio.com/products/rstudio/release-notes/