splor-mg / volumes-docker

0 stars 0 forks source link

Error in loadNamespace(name) : there is no package called ‘dotenv’ #6

Closed fjuniorr closed 1 year ago

fjuniorr commented 1 year ago

Tentando criar uma imagem pra seguir com https://github.com/splor-mg/volumes-loa/issues/33 recebi o erro abaixo que definitivamente não deveria estar acontecendo porque a imagem base (rocker/verse:3.6.3) deveria ser versionada

=> [2/8] WORKDIR /home/rstudio                                                                                       0.4s
 => [3/8] COPY texmf /opt/texmf-local                                                                                 0.1s
 => [4/8] RUN texhash                                                                                                 1.4s
 => [5/8] RUN Rscript -e "install.packages('dotenv')"                                                                 5.2s
 => ERROR [6/8] RUN --mount=type=secret,id=secret Rscript -e     "dotenv::load_dot_env('/run/secrets/secret'); remot  1.2s
------
 > [6/8] RUN --mount=type=secret,id=secret Rscript -e     "dotenv::load_dot_env('/run/secrets/secret'); remotes::install_bitbucket('dcgf/relatorios@v0.6.75', auth_user = Sys.getenv('BITBUCKET_AUTH_USER'), password = Sys.getenv('BITBUCKET_APP_PASSWORD'))":
#11 1.119 Error in loadNamespace(name) : there is no package called ‘dotenv’
#11 1.119 Calls: :: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
#11 1.120 Execution halted
------
executor failed running [/bin/sh -c Rscript -e     "dotenv::load_dot_env('/run/secrets/secret'); remotes::install_bitbucket('dcgf/relatorios@$relatorios_version', auth_user = Sys.getenv('BITBUCKET_AUTH_USER'), password = Sys.getenv('BITBUCKET_APP_PASSWORD'))"]: exit code: 1
make: *** [build] Error 1
fjuniorr commented 1 year ago

Eu consigo fazer build da imagem até a instalação do dotenv mas parece que ele não está sendo efetivamente instalado. Chequei isso com


ls /usr/local/lib/R/site-library | grep dotenv
ls /usr/local/lib/R/library | grep dotenv

Ao tentar instalar de modo interativo acho que descobri que o problema é que o MRAN foi descontinuado e isso impacta nossa imagem.

> install.packages('dotenv')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://mran.microsoft.com/snapshot/2020-04-24/src/contrib:
  cannot open URL 'https://mran.microsoft.com/snapshot/2020-04-24/src/contrib/PACKAGES'
Warning message:
package ‘dotenv’ is not available (for R version 3.6.3)