rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

r-base:3.5.0 Warning: unable to access index for repository https://cloud.r-project.org/src/contrib #357

Closed mgb1028 closed 3 years ago

mgb1028 commented 5 years ago

I am trying to build a docker image using the r-base:3.5.0 docker image. I am using a Dockerfile that I had been using for a while and has all of a sudden started returning an error.

When running docker build I receive the following error:

Warning: unable to access index for repository http://cran.rstudio.com/src/contrib:
  internet routines cannot be loaded
Warning message:
package ‘tidyverse’ is not available (for R version 3.5.0)

Below is the source of the docker file:

FROM r-base:3.5.0

WORKDIR /app

# System dependencies
RUN apt-get update \
    && apt-get install -y \
      libssl-dev \
      libcurl4-openssl-dev \
      libxml2-dev

# R dependencies
RUN install2.r --error --deps TRUE tidyverse
RUN install2.r --error --deps TRUE lubridate
RUN install2.r --error --deps TRUE feather
RUN install2.r --error --deps TRUE magrittr
RUN install2.r --error --deps TRUE Rcpp
RUN install2.r --error --deps TRUE data.table
RUN install2.r --error --deps TRUE aws.s3

ADD preprocess.R .
ADD buscar_indice_primer_positivo.cpp .
ADD buscar_indice_ultimo_positivo.cpp .

ENTRYPOINT ["Rscript", "/app/preprocess.R"]

This Dockerfile is very similar to another Dockerfile that still works, where the only difference is the installation of openjdk-8-jdk in the latter. Adding this to previous image allows it to build. That means in the Dockerfile above I change the installation the libraries to

RUN apt-get update \
    && apt-get install -y \
      libssl-dev \
      libcurl4-openssl-dev \
      libxml2-dev \
      openjdk-8-jdk

I am not entirely sure why the java package is necessary for to access the cran repository and why it wasn't necessary before. It's purpose the Dockerfile that I copied it from is for a spark program.

If I increase the version of R to 3.5.1 or greater this error goes away but then I encounter inconsistencies in the code.

Any help would be greatly appreciated. Thank you.

cboettig commented 5 years ago

Hmm, not sure why r-base:3.5.0 would change. Have you tried rocker/r-ver:3.5.0?

eddelbuettel commented 5 years ago

http://cran.rstudio.com/src/contrib

Maybe it is the old and baked in setting for http rather than https? (Guessing here...)

mgb1028 commented 5 years ago

I just tried with rocker/tidyverse:3.5.0 and everything was fine.

@eddelbuettel, would a solution be to change the repo in the installation.

Let me know if you need anymore information.

eddelbuettel commented 5 years ago

The underlying R package now has that set: https://salsa.debian.org/edd/r-base/blob/master/debian/Rprofile.site

But I didn't do that when R 3.5.0 was current as you (initially ?) chose an old release, and hence old code for the Dockerfile, it didn;t have that. The r-ver containers are newer, but get remade to the old codebase yet can reflect newer choice just like this one. (See our R Journal paper for more on the different stacks offered).

I don't think there is a bug here. You ran old code, it reflects older coding practice. Also, why not just use R 3.6.1?

leungi commented 4 years ago

@mgb1028 : I run into the same error message occasionally, and the solution has been to restart docker.