Home > other >  R - renv suddently broke and now I can't download any packages
R - renv suddently broke and now I can't download any packages

Time:09-20

I am working on a project and everything was working fine, but all of a sudden I can't seem to download any other packages I've tracked the issue to renv and found someone else who had the same problem. However, the solution offered is only a work-around and a possible security risk.

Here is my error (I removed ggplot2 and I am now re-installing it):

install.packages("ggplot2")

Error: package 'ggplot2' is not available

In addition, I get these warning messages:

1: could not retrieve available packages for url "https://cloud.r-project.org/src/contrib"
2: could not retrieve available packages for url "https://cloud.r-project.org/bin/windows/contrib/4.2"
3: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
4: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
5: package 'ggplot2' is not available
6: failed to retrieve 'https://rstudio-buildtools.s3.amazonaws.com/renv/mran/packages.rds' [error code 35]

I tried to use renv::equip() but got this message:

Error: failed to retrieve 'https://s3.amazonaws.com/rstudio-buildtools/extsoft/curl-7.77.0-win32-mingw.zip'
[error code 35]
In addition: Warning message:
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

I don't know what happened, I'm not a security expert so any help would be appreciated.

I used to think that renv was having problems with AWS, but I tried it in a different PC and it worked fine.

What I want to know is:

  • How can I fix the underlying problem so I can normally and securely install packages with renv again?
  • What caused the issue in the first place (it was working fine before)?

CodePudding user response:

Most likely, the download methods selected by renv is non-functional in your environment for some reason. If you need a workaround in the future, you can probably set:

Sys.setenv(RENV_DOWNLOAD_METHOD = getOption("download.file.method"))

CodePudding user response:

I managed to fix the issue through a combination of 4 actions (I am unsure as which one did the trick):

  1. Uninstalled R
  2. Uninstalled R-studio
  3. Deleted the renv folder and the renv.lock file
  4. Uninstalled my antivirus for good measure.

I then re-installed R, Rstudio, and renv and everything was working once again.

Hopefully this will be of use to someone in the same situation in future

  • Related