8

Three days ago I could install packages without any problems on three different systems. R was rebuilt on all three systems (Gentoo forced a rebuild) and now I'm unable to download and install from CRAN on any of them....

> install.packages('rmarkdown')
Warning: unable to access index for repository https://r-forge.r-project.org/src/contrib:
  internet routines cannot be loaded
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:
  internet routines cannot be loaded
Warning: unable to access index for repository https://cran.uk.r-project.org/src/contrib:
  internet routines cannot be loaded

These are the three repositories I define in .Rprofile...

## Set CRAN mirrors
local({r <- getOption("repos"); r["CRAN"] <- "https://cran.uk.r-project.org"; options(repos=r)})
options(repos=c(RStudio='https://rstudio.org/_packages', getOption('repos')))
options(repos=c(RStudio='https://cran.rstudio.com/', getOption('repos')))

And for full information..

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Gentoo/Linux

locale:
 [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C             
 [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8    
 [5] LC_MONETARY=en_GB.utf8    LC_MESSAGES=en_GB.utf8   
 [7] LC_PAPER=en_GB.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C      

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

other attached packages:
[1] devtools_1.10.0

loaded via a namespace (and not attached):
[1] memoise_1.0.0 digest_0.6.9 

Searching I've found several threads on this. The first two are just where mirrors are down or mis-specified because https was not supported...

...neither of which are the problem here since I'm using mirrors which are up (e.g.). I then came across the two following threads (one references the other)...

There is also reference to a thread on R-help from November last year.

Reading these its seems the problem could be one of a few things...

  • A problem with LD_LIBRARY_PATH not being set in my systems environment.
  • A problem with SSL support.

Problem with LD_LIBRARY_PATH

Checking this I get across my three systems...

> Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/lib64/R/lib:/usr/lib64/blas/reference:/usr/lib64/lapack/reference"
> Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/lib64/R/lib:/usr/lib64/blas/reference:/usr/lib64/lapack/reference:/etc/java-config-2/current-system-vm/jre/lib/amd64/server"
> Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/lib64/R/lib:/usr/lib64/blas/reference:/usr/lib64/lapack/reference:/etc/java-config-2/current-system-vm/jre/lib/amd64/server"

So R can find its own libraries ok. This suggests its perhaps the other problem SSL support

Problem with SSL Support

I found someone else who'd had this problem (see here) so I checked whether Curl could access the URLs and therefore had SSL support...

# curl https://cran.rstudio.com/src/contrib/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /src/contrib</title>
 </head>
 <body>
<h1>Index of /src/contrib</h1>
<table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>
<tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/src/">Parent Directory</a></td><td>&nbsp;</td><td align="right">  - </td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="00Archive/">00Archive/</a></td><td align="right">03-Mar-2016 04:50  </td><td align="right">  - </td><td>&nbsp;</td></tr>
....

So it looks like Curl is working ok and I can access the URLs but R can't.

Any pointers on how to resolve this would be welcome as I can't figure it out.

Thanks in advance.

Community
  • 1
  • 1
slackline
  • 2,295
  • 4
  • 28
  • 43

1 Answers1

0

I tried starting a plain R sessions with R --vanilla (suggested in an earlier post on R-help) and its revealed a little more information...

# R --vanilla

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages('rmarkdown')
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) : 
  internet routines cannot be loaded
In addition: Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
  unable to load shared object '/usr/lib64/R/modules//internet.so':
  /usr/lib64/libcurl.so.4: undefined symbol: SSLv2_client_method
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file '/usr/share/doc/R-3.2.3/CRAN_mirrors.csv': No such file or directory

I've therefore rebuilt net-misc/curl-7.47.1 and dev-lang/R-3.2.3 from source and resolved the problem.

slackline
  • 2,295
  • 4
  • 28
  • 43
  • I am experiencing something similar here except my undefined symbol is like this: `unable to load shared object '/usr/local/lib64/R/modules//internet.so': /usr/local/lib64/R/modules//internet.so: undefined symbol: curl_multi_wait`. Could you give some more details on how you rebuilt R and curl? I just installed R and built curl so I wondering if rebuild order has any import here. – boshek Apr 22 '16 at 21:25
  • Sure, I use Gentoo, so all packages are installed from source. Under Gentoo I simply ran `emerge =net-misc/curl-7.47.1 =dev-lang/R-3.2.3` which rebuild and installed the two packages. – slackline Apr 25 '16 at 12:26