1

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)?
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
cach1
  • 105
  • 8
  • can you reach CRAN OK? Are you using a proxy server or firewall? – monkey Sep 18 '22 at 02:15
  • @monkey Thanks for the interest. I'm not using a proxy or firewall. If I do `renv::deactivate()` I can install everything without any issues. – cach1 Sep 18 '22 at 03:10
  • Have you tried it again? – IRTFM Sep 18 '22 at 05:56
  • @IRTFM, I did and after using `renv::activate()` I still had the same problem. I was able to fix the issue though with the process described bellow. – cach1 Sep 18 '22 at 06:19

4 Answers4

2

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"))
Kevin Ushey
  • 20,530
  • 5
  • 56
  • 88
  • Thank you for your help! If I ever do get this issue again I'll be sure to try it. Thanks again! – cach1 Sep 19 '22 at 20:15
2

I found this stackoverflow question under the following circumstances:

  • I was using Microsoft R Open 4.0.2 but needed to upgrade to Windows R 4.3.1
  • I am working within corporate firewalls

I made renv download packages securely by making a fresh renv project and adding the following steps to the project-level ".Rprofile":

Kevin Woo
  • 101
  • 1
  • 4
0

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

cach1
  • 105
  • 8
0

It happened to me that i just had too many projects opened, and the memory used by the r session wasn´t enough for installing new packages. Just closed a few projects and it worked!

Epalp
  • 1