devtools::release() Error in 'git2r_remote_fetch': unknown certificate check failure - r

I am trying to run devtools::release to submit a R package I have written to CRAN and I get the following error message:
devtools::release()
Checking if synched with remote branch...
ERROR: Error in 'git2r_remote_fetch': unknown certificate check failure
I have been able to upload and download my package from GitHub without issues in the past, and the version of the package on my computer is up to date with the version on GitHub. The CMD checks on my computer throw up no issues. Can anyone advise what might be the issue?

This is most likely a security issue (see here; I'm guessing you're using Windows). I had a similar problem, and was being suddenly asked for passwords all the time. I was able to resolve it by downloading and installing the latest version of Git from here.
If you restart your R session, devtools should work properly with Github again.

Related

R Session Aborted when loading mailR in R4.2.0

I have just updated to R4.2.0 (previously R3.2) and I now get R Session Aborted when loading the package on windows. Same error when running directly from R. Everything seems ok when I install the mailR package. I also updated all dependencies.
Could someone help with this?
I had to update my RTools to the newest version, 4.2
https://cran.rstudio.com/bin/windows/Rtools/rtools42/rtools.html
Then I uninstalled both rJava and mailR, and reinstalled them again after the update without any issue.
Just as a side note, after a lot of headaches in Linux with mailR, trying to keep my java libraries updated, I finally switched to a curl-based email library, emayili: https://datawookie.github.io/emayili/
I found those Java dependencies would crop up as issues a few times a year in different systems, and haven't had any of the same with the new libraries.

How to install R packages when github is blocked using papaja as an example

I thought I would post this as an answer to anyone having problems installing papaja (or other packages) when behind a firewall that doesn't allow github
The problem
For reasons I dont fully understand, the only way I am able to use github R packages is to download them into my github desktop and then use them using the remotes::install_local("C:\\[path]\\GitHub\\papaja") function. This has worked for all the R packages available from github (CRAN installations are fine).
However this is not the case with papaja which gives me the error:
'Error in curl::curl_fetch_memory(url, handle = h) :
Failed to connect to api.github.com port 443: Connection refused'
I suspect this is because a call is being made to github during the package installation (otherwise why dont I get this issue with all of the other packages I've installed this way).
The attempts
So I went ahead and tried
remotes::install_local("C:\\[path]\\GitHub\\papaja",dependencies=FALSE)
It gave me the error:
ERROR: dependencies 'bookdown', 'rmdfiltr' are not available for package 'papaja'
The answer
So I installed these separately from CRAN and then re ran
remotes::install_local("C:\\[path]\\GitHub\\papaja",dependencies=FALSE)
and the papaja successfully installed. So I guess the installation for the dependencies bookdown and rmdfiltr are making a call to github when they could be installed from CRAN?
So I guess if you get the same error, switch off dependecy installation and install them separately

Build fails automatic checks on CRAN but not on any local checks

I am trying to submit a new package to CRAN. After submitting, I got a response that it been rejected beacuse it did not pass the automated checks.
Specifically, the error message was as follows for the Windows build.
* checking package dependencies ... ERROR
Package required but not available: 'readr'
See the log for Windows here. It passed all checks for the Debian build fine (side note, I am fixing the NOTES relating to URL's).
The package passes all check on my local machine (Mac OS) as well as on travis-ci and using rhub/devtools to test on Windows. Specifically, I can run the following all without errors.
devtools::check()
devtools::check_win_develop()
rhub::check_for_cran()
Regarding readr which seems to be the cause of the issue, it is in the DESCRIPTION file as an Import and seems to be referenced correctly in the various functions. And again, all the above checks pass fine.
Is there some other way to test for CRAN that I'm missing here? I'm hesitant to resubmit without any changes but am not really sure what to change as I can't work out what is going wrong.
For reference, the package is on github.

R devtools::install_github() error in download: unauthorized

I'm trying to tie R to Twitter and everything I try has been failing. I've been looking at several links including the following: One, Two, Three
While those have led to more issues, I'm now looking at the links here and here to try some workarounds. I would have posted my question as a comment to either of these links but I don't have enough rep yet.
When I run the following code, I get the following error
Code:
library(base64enc)
library(RCurl)
library(httr)
set_config( config( ssl_verifypeer = 0L ) )
devtools::install_github("jrowen/twitteR", user="MY_USERNAME", password="MY_PASSWORD", ref = "oauth_httr_1_0")
Error:
WARNING: Rtools is required to build R packages, but is not currently installed.
Please download and install Rtools 3.3 from http://cran.r-project.org/bin/windows/Rtools/ and then run find_rtools().
Downloading GitHub repo jrowen/twitteR#oauth_httr_1_0
Error in download(dest, src, auth) : client error: (401) Unauthorized
Am I just completely missing something here in how to download this dev twitteR package? Does anyone have an idea on how to get past the 401 error?
Thanks,
Have you installed and sourced R tools in the session you are referencing above? You aren't getting a certificate error (were you before?) which suggests you don't have a certificate server you're running under as was the issue in some of your linked posts.
I would suggest the following steps to find your issue.
You may need the httpuv package which can be downloaded sourced with
install.packages('httpuv')
library('httpuv')
Sometimes the twitteR package needs an older version of httr to work correctly, depending on jrowen's (and hadley's) updates.
You may try installing the older version of httr
devtools::install_version("httr", version="0.6.0", repos="http://cran.us.r-project.org")
and restarting R and then trying your install again. Note that if you are on a 64-bit machine, you will probably have to install the most recent version of httr first, then install the older version.

I am unable to use install.packages with the pkgs parameter to install a package from a local file (Win8.1, R3.10)

I am trying to install the rClr package. The instructions for this are to copy the package file onto the local computer and use install.packages(pkgs = "c:/.../rClr_0.5-2.zip"). I have a laptop, a server and a desktop. The laptop and the desktop are Windows 8.1, the server Windows 2012. All run R 3.1.0. The desktop installs rClr without a problem. The other two return the warning (error) message:
package ‘c:/.../rClr_0.5-2.zip’ is not available (for R version 3.1.0).
I've tried all obvious things. The error is pretty generic, it is given whenever install.packages can't find a file. The package is compatible with R 3.1.0, as evidenced by the fact it installs on my desktop. I've check for silly mistakes. I've tried moving the file to simpler directory structures (in case install.packages had a problem with spaces or special characters), I've given it maximum file permissions, tried playing around a few other things, but nothing makes a difference. I also tried replacing the local reference with a reference to the http link, and tried download another random package from CRAN to see if that would install, and both gave the same error message. I can't think of anything different in the environment of the laptop and the desktop. install.packages does work when installing the standard packages from CRAN.
Am I missing something obvious? Is there any known issue with install.packages (I thought maybe security but couldn't find anything on internet)? Are their ways to force an installation? Can anyone recommend something else to try?
Thanks.

Resources