SSL-certificates installing packages in R 4.2 - r

I have a problem with a custom local CRAN-mirror (jfrog) under windows on a machine without access to the internet:
in R 4.1.2, I have no problems accessing the mirror via https,
in R 4.2.0, I get errors that the index in PACKAGES can not be accessed via https.
After browsing the web and SO, I saw some more problems alike but none quite the same (see, e.g. here), I got around this issue by adding to my .Rprofile
options(repos = c(CRAN = "internalrepo"),
download.file.method = "curl",
download.file.extra = "-k -L")
to bypass checking SSL-certificates.
This works for me on a computer with access to the local network only, but it seems a bad idea on computers connected to the internet using a custom CRAN mirror.
Also, I would like to understand the cause of the problem. Did something change in the way that R handles SSL-certificates or did we break something in the installation of R 4.2?
sessionInfo() and Sys.getenv() do not show much difference between R 4.1.2 and R 4.2.0 but in R 4.2.0, I saw that there is an additional environment variable
CURL_CA_BUNDLE that points to the R installation directory /etc/curl-ca-bundle.crt

EDIT: 2022-12-14: I believe I tracked down the issue - it's SSL revocation checks that failed when a system only has access to a local network. A new flag was added to 4.2.1+ that can be set to TRUE, allowing SSL revocation checks to be given 'best-effort' attempts to contact, then bypassed. https://bugs.r-project.org/show_bug.cgi?id=18379 But if a machine has internet access, revocation checks will still be allowed to occur, which, I think, is probably the best we can hope for.
ORIGINAL: Just letting you know #clemenskuehn we have the same thing - local mirror working fine in 4.1.2 over HTTPS on some restricted data systems that aren't allowed internet access, then suddenly we update to 4.2.1 on our windows & linux boxes, and the windows machines only (linux works fine) aren't able to use the local mirror anymore,
"warning: unable to access index for repository https://mirror.oursite.com/cran/src/contrib:
cannot open URL 'https://mirror.oursite.com/cran/src/contrib/PACKAGES"
so it's not just you. Did you open a tracker with the R developers? Your workaround works for us so we might put it into production as a stopgap but it definitely be good if we didn't have to allow insecure connections, even though these systems can't get outbound access anyway.

Related

R will not run after latest windows 10 updates

I have updated my windows and R cannot run, and hence neither can R studio. When I run R GUI it just freezes and is unresponsive. I have allowed chromium exemption to the firewall
I am on Windows Insider program and has just updated to
Windows 10 Home, Insider Preview
Evaluation Copy.Build 20190.rs_prerelease.200807-1609
Note that R GUI freezes and then shuts down on its own, so maybe the problem is R GUI and not R Studio.
I get the following errors on R studio.
This site can’t be reached
127.0.0.1 refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
Cannot Connect to R
RStudio can't establish a connection to R. This usually indicates one of the following:
The R session is taking an unusually long time to start, perhaps because of slow operations in startup scripts or slow network drive access.
RStudio is unable to communicate with R over a local network port, possibly because of firewall restrictions or anti-virus software.
Please try the following:
If you've customized R session creation by creating an R profile (e.g. located at ~/.Rprofile), consider temporarily removing it.
If you are using a firewall or antivirus software which guards access to local network ports, add an exclusion for the RStudio and rsession executables.
Run RGui, R.app, or R in a terminal to ensure that R itself starts up correctly.
Further troubleshooting help can be found on our website:
Troubleshooting RStudio Startup
This has been fixed with Windows 10 Insider Preview Build 20201 (released on August 26, 2020 in the Dev channel).The previous two builds were missing 64-bit APIs required by the prebuilt version of R.
Same issue.
Rollback to the previous version solves the problem.
I think it is about the update of the graphic features of Windows.
Here is what Microsoft said in the build 20190 changelog:
Improved Graphics Settings experience
While this isn’t a new feature all together, we have made significant changes based on customer feedback that will benefit our customers’ Graphics Settings experience. We have made the following improvements:
We’ve updated the Graphics Settings to allow users to specify a default high performance GPU.
We’ve updated the Graphics Settings to allow users to pick a specific GPU on a per application basis.

Unable to access internet within "R" on cmd behind proxy

I have been using R on commandline (BASH). I am unable to access the internet (download any packages). I have tried proxy system wide, and tested it with wget, which works. The "install.packages()" command however does not.
Per some user's advice, I also tried setting the proxy in .Rprofiles file. That didn't help either. Please advice.
I recently ran into the same issue on my work machine. Our Firm uses Cylance as its antivirus software. Cylance was quarantining the file "internet.dll" that R uses to access the Internet. Fortunately, however, it only does so in the 32-bit version of R. For me, there were two solutions:
First, I was able to download packages directly from the 32-bit version of R (outside of RStudio). This works fine. The downloaded packages will run in 64-bit RStudio.
The longer-term solution was to submit an IT service request to release this file from quarantine (that is, to "whitelist a blocked entity"). At my Firm this was promptly done, as there is (obviously) nothing unsafe about this R file.

Unable to install packages on macos

When I try to install a package in R on macOS I get the following error, both using the GUI menu or install.packages:
Warning: unable to access index for repository https://cran.uni-muenster.de/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'https://cran.uni-muenster.de/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
There are many Q&A on this site relating to this issue, and none of the answers provided there worked for me.
I tried disabling my firewall, changed all possible settings in the R preferences, checked in my browser whether the packet was online and available (it was), used different options and mirrors, both http and https, in install_packages, to no avail.
If you use Little Snitch, check the rules.
I use Little Snitch in quiet mode and have never defined any rules, and yet Little Snitch had a rule that blocked R from accessing the internet. Maybe Little Snitch installs with a certain set of base rules or creates rules for certain types of software by default. My bit torrent client (qbittorrent) and Cisco's VPN client, which I use to access my university network from home, were both blocked out of the box as well.
I deleted that rule and now packet installation works fine.

R: Terminal IDE for Centos6 server without admin access

I need a replacement for RStudio Server which I can install and manage myself on a remote server (no sudo access). Gedit + XQuartz on my MacBook performs very poorly due to the lack of integration with R.
I was looking at vimR, and it appears to have the functionality that I need and should be able to easily extend to Python and other programming languages, which is important. But I think this guide is out of date, and the installation of dependencies is convoluted and ultimately requires installing via the package manager which is not an option.
Are there other alternatives to this? Google has not brought up anything useful so far.

Building R package for windows on mac

Question:
I am developing an R package. I have not yet submitted to CRAN (and it's not ready to at any rate). I want to send the package to friend for some preliminary testing (he's not a builder) and I just want to see if he can use a few features.
On my Mac version of RStudio, I can generate binaries easily. It creates a file called "iatgen_1.0.tgz"
Can my friend use that to install my early build on his windows machine? Or do I need to do something to that file to make it usable for a windows user. Let's assume I have NO access to a windows machine. What can I do from my mac to make this package usable by windows users?
I am posting my comment as an (extended) answer because I think it will help you. When I built my package, I did not have access to Windows either and was suffering from the same issue. I discovered the the Windows build service offered at http://win-builder.r-project.org/ and it worked great. You'll need to do a few things before you send it in, and this is all explained on the site.
First, build your source package with R CMD build. Next, check the package with R CMD check. If this succeeds, follow the rest of the instructions on the site and if all goes well they will send you a link to the temporary directory on their server where you can download the Windows build. If all does not go well, Mr. Ligges will send you an email with the detailed issues so you can fix them and try again.
Like I said, the service worked very well for me. The response was prompt and there were absolutely no problems.

Resources