RStudio Package installation error (with newer versions?)

Hi All-

Just got a new laptop (to replace my 8 y/o Yoga 900). Installing all the new versions of R, RStudio, and RTools 4.3. I started trying to install packages from the console, and I am getting the following errors (after my commentary) using the gt package as an example to test for package installation.

New laptop version(s): RStudio (2023.12.0 Build 369), R (4.3.2), Windows 11 Home

Old laptop version(s): RStudio (2023.09.01 Build 494), R (4.3.2) Windows 10 Pro

I have followed Google search results to disable https, try another download mirror, and a few other options to get it to work, however, I am at a loss for why packages download fine on my old machine with all https settings and RStudio mirror selected, but on the new laptop I have to jump through all these hurdles.

Currently, the only two hypotheses I have at the moment are Win10 versus Win11 issues, or something happening between the 2023.09 and 2023.12 versions of RStudio, as all the settings within Global options are the same on both machines. Any guidance would be greatly appreciated!

> install.packages("gt")
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/src/contrib:
  cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Installing package into ‘C:/Users/james/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
also installing the dependencies ‘V8’, ‘reactR’, ‘bigD’, ‘bitops’, ‘htmlwidgets’, ‘juicyjuice’, ‘markdown’, ‘reactable’

Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/4.3:
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/PACKAGES'
Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘V8’ ‘bitops’
installing the source packages ‘V8’, ‘reactR’, ‘bigD’, ‘bitops’, ‘htmlwidgets’, ‘juicyjuice’, ‘markdown’, ‘reactable’, ‘gt’

trying URL 'https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz'
Warning in install.packages :
  download of package ‘V8’ failed
trying URL 'https://cran.rstudio.com/src/contrib/reactR_0.5.0.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/reactR_0.5.0.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/reactR_0.5.0.tar.gz'
Warning in install.packages :
  download of package ‘reactR’ failed
trying URL 'https://cran.rstudio.com/src/contrib/bigD_0.2.0.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/bigD_0.2.0.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/bigD_0.2.0.tar.gz'
Warning in install.packages :
  download of package ‘bigD’ failed
trying URL 'https://cran.rstudio.com/src/contrib/bitops_1.0-7.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/bitops_1.0-7.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/bitops_1.0-7.tar.gz'
Warning in install.packages :
  download of package ‘bitops’ failed
trying URL 'https://cran.rstudio.com/src/contrib/htmlwidgets_1.6.4.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/htmlwidgets_1.6.4.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/htmlwidgets_1.6.4.tar.gz'
Warning in install.packages :
  download of package ‘htmlwidgets’ failed
trying URL 'https://cran.rstudio.com/src/contrib/juicyjuice_0.1.0.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/juicyjuice_0.1.0.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/juicyjuice_0.1.0.tar.gz'
Warning in install.packages :
  download of package ‘juicyjuice’ failed
trying URL 'https://cran.rstudio.com/src/contrib/markdown_1.12.tar.gz'
Content type 'application/x-gzip' length 113037 bytes (110 KB)
downloaded 110 KB

trying URL 'https://cran.rstudio.com/src/contrib/reactable_0.4.4.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/reactable_0.4.4.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/reactable_0.4.4.tar.gz'
Warning in install.packages :
  download of package ‘reactable’ failed
trying URL 'https://cran.rstudio.com/src/contrib/gt_0.10.1.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/gt_0.10.1.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/gt_0.10.1.tar.gz'

The RStudio version does not matter for this, and if you disabled HTTPS, then I suggest that you enable it again, because disabling it will only make things worse. What's the output of

sessionInfo()

?

> sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.2    cli_3.6.2         tools_4.3.2       rstudioapi_0.15.0

I made sure all https options were enabled, and then I changed the mirror from

Global (CDN) - RStudio

to the USA(TN) Mirror, and that seemed to fix the problem. Again, I am using the RStudio mirror on my old laptop and everything works just fine. Would like to fix the issue so that I can run off the RStudio mirror on my new laptop.

What's the output of

download.file("https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz", tempfile())

?

> download.file("https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz", tempfile())
trying URL 'https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz'
Error in download.file("https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz",  : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz'
In addition: Warning message:
In download.file("https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz",  :
  URL 'https://cran.rstudio.com/src/contrib/V8_4.4.1.tar.gz': status was 'SSL connect error'

After doing a bit of research, and seeing that other mirrors are working as intended, it could be from Posit's end (see reddit thread post here).

https://www.reddit.com/r/RStudio/comments/13dc665/suddenly_unable_to_installupdate_packages/

I have tried multiple US mirrors and have been able to successfully install from all of them (TN, PA 2, OR, OH, NC mirrors). Only the global RStudio mirror has this problem. Based on the reddit thread and some other Posit Community posts, it appears that something may be doing on with the Global (CDN) - RStudio (Posit) SSL Certificate.

This also can happen if your Windows SSL root certificates are out of date. Make sure you’ve applied all Windows Updates and that your system is fully up to date.

Will check into this, again this is a new laptop, and I went through the process of applying all Windows updates after initial setup (Windows 11 Home edition).

Yeah, I assumed that as well. Do you see any site certificate errors when opening https://cran.rstudio.com/ in a web browser?

I will get a ERR_CONNECTION_RESET window, but then the browswer will "self refresh" after a couple seconds and show the site. I also tested on the .../contrib/ page and the .../contrib/4.3/PACKAGES/ page.

Wondering if the SSL error has something to do with the fact the browser self refreshes to access the page, but in R the initial fail causes the install.packages() command to fail, as well as any dependencies that are required.

So not a solution to the problem (so that I can just use point and click RStudio download mirror with https option enabled), but I used the following options command to update mirror to the following address:

> remove.packages("vroom")
Removing package from ‘C:/Users/james/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)

> options(repos="https://CRAN.R-project.org")

> install.packages("vroom")
Installing package into ‘C:/Users/james/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://CRAN.R-project.org/bin/windows/contrib/4.3/vroom_1.6.5.zip'
Content type 'application/zip' length 1331638 bytes (1.3 MB)
downloaded 1.3 MB

package ‘vroom’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\james\AppData\Local\Temp\RtmpcbZhVr\downloaded_packages

I do not know the exact address of the Global (CDN) - RStudio mirror (https://cran.rstudio.com/ ???). Obviously not wanting to nit pick and waste time, but the assumption is that this should work out of the box on a Windows installation. As this is a brand new laptop (Windows 11 Home), would think it would work like my 8 y/o laptop. I have seen other posts on Posit community, Reddit, and other forums/sites that show up every 2-3 months with the same issue. Every time there appears to be a workaround for the user (turning off https downloads, use another mirror besides Posit), and not an actual fix to the Posit mirror itself.

Feel free to mark this issue as "resolved", however I don't think this is the last time we will see this issue pop up amongst users.

Thank you for attempting to assist, I appreciate it!