Skip to content

Installation of packages using Devtools Fails - error setting certificate #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paupereira opened this issue Apr 13, 2018 · 8 comments
Closed

Comments

@paupereira
Copy link

Problem:

When I run

devtools::install_github('xuyiqing/gsynth')

I get the error

Installation failed: error setting certificate verify locations:
  CAfile: microsoft-r-cacert.pem
  CApath: none

System info:

Sys.info()
                                      sysname                                       release 
                                      "Linux"                              "4.4.0-1052-aws" 
                                      version                                      nodename 
"#61-Ubuntu SMP Mon Feb 12 23:05:58 UTC 2018"                            "ip-172-31-23-240" 
                                      machine                                         login 
                                     "x86_64"                                     "unknown" 
                                         user                                effective_user 
                                     "ubuntu"                                      "ubuntu" 

R version:

> R.version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          4.3                         
year           2017                        
month          11                          
day            30                          
svn rev        73796                       
language       R                           
version.string R version 3.4.3 (2017-11-30)
nickname       Kite-Eating Tree  
@huangteng1220
Copy link

I had the same problem. Have you solved the problem?

@jona-sassenhagen
Copy link

Same problem.

@elmstedt
Copy link

elmstedt commented May 3, 2018

EDIT: After some more searching I found this thread:
https://social.technet.microsoft.com/Forums/ie/en-US/aec2c852-109a-4fc3-95f9-6fe61e779adf/rvest-readhtml-function-does-not-work?forum=ropen

The workaround, for now, seems to be uninstalling curl and httr, restarting R, reinstalling those packages, then setting the CURL_CA_BUNDLE system environment.

  1. Open a new MRO session and remove the packages 'curl' and 'httr':

    remove.packages(c("curl","httr"))

  2. Restart MRO and install the packages again, this time using 'install.packages()' function:

    install.packages(c("curl", "httr"))

  3. Set the environment variable 'CURL_CA_BUNDLE':

    Sys.setenv(CURL_CA_BUNDLE="/utils/microsoft-r-open-3.4.3/lib64/R/lib/microsoft-r-cacert.pem")

############################################################################
Original comment:

Same problem here.

sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.4 LTS

Matrix products: default
BLAS: /opt/microsoft/ropen/3.4.3/lib64/R/lib/libRblas.so
LAPACK: /opt/microsoft/ropen/3.4.3/lib64/R/lib/libRlapack.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] curl_3.1 devtools_1.13.4 RevoUtils_10.0.7 RevoUtilsMath_10.0.1

loaded via a namespace (and not attached):
[1] httr_1.3.1 compiler_3.4.3 R6_2.2.2 tools_3.4.3 withr_2.1.1 yaml_2.1.16 memoise_1.1.0 git2r_0.20.0 digest_0.6.13

##################################################################################

Sys.getenv("CURL_CA_BUNDLE")
[1] ""
ie_get_proxy_for_url("https://www.google.com")
NULL
ie_proxy_info()
NULL
Sys.getenv("https_proxy")
[1] ""
readLines(base::url("https://httpbin.org/get"))
Error in readLines(base::url("https://httpbin.org/get")) :
cannot open the connection to 'https://httpbin.org/get'
In addition: Warning message:
In readLines(base::url("https://httpbin.org/get")) :
URL 'https://httpbin.org/get': status was 'Problem with the SSL CA cert (path? access rights?)'
Sys.getenv("CURL_CA_BUNDLE")
[1] ""

@arisbw
Copy link

arisbw commented May 18, 2018

Hi, I tried to set CURL_CA_BUNDLE to /opt/microsoft/ropen/3.4.4/lib64/R/lib/microsoft-r-cacert.pem since the certificate exists in that path for my case. And before that, I also uninstalled RCurl (since there is no package named curl in the first place so I assume RCurl still the same thing) and httr. But still, I failed to install package from GitHub.

> devtools::install_github('IRkernel/IRkernel')
Installation failed: error setting certificate verify locations:
  CAfile: microsoft-r-cacert.pem
  CApath: none

Any suggestion?

EDIT: Apparently it didn't work because before that I tried to edit Rprofile.site using this #6 (comment) solution. After I undo that edit and then followed the solution provided by @jakekramer, now it works.

@fanyang1997
Copy link

The problem is due to a change in the R package 'curl'.

You can workaround the issue as follows:

1). Open a new MRO session and remove the packages 'curl' and 'httr':

remove.packages(c("curl","httr"))

2). Restart MRO and install the packages again, this time using 'install.packages()' function:

install.packages(c("curl", "httr"))

3). Set the environment variable 'CURL_CA_BUNDLE':

Sys.setenv(CURL_CA_BUNDLE="/utils/microsoft-r-open-3.4.3/lib64/R/lib/microsoft-r-cacert.pem")

4). Try installing a package using install_github() from github(this should now work):

For example:

install_github("ropensci/tokenizer")

@bjungbogati
Copy link

Go to your Renvironment location:
/opt/microsoft/rclient/3.4.3/runtime/R/etc/Renviron

insert following line with sudo access:
CURL_CA_BUNDLE=/opt/microsoft/rclient/3.4.3/runtime/R/lib/microsoft-r-cacert.pem

@ShixiangWang
Copy link

> file.edit('~/.Renviron')

then write:

CURL_CA_BUNDLE=/opt/microsoft/ropen/3.5.1/lib64/R/lib/microsoft-r-cacert.pem

This works for me.

@ShawnMeng90s
Copy link

don't have access to > file.edit('~/.Renviron')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants