Skip to content
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

Crash on install_github remains #532

Closed
jankowtf opened this issue Jul 29, 2014 · 9 comments
Closed

Crash on install_github remains #532

jankowtf opened this issue Jul 29, 2014 · 9 comments

Comments

@jankowtf
Copy link

I have the same problem as described here and also followed the advice with update.packages(checkBuilt = TRUE).

Still, R crashes upon calling install_github():

> install_github("rstudio/packrat")
Installing github repo packrat/master from rstudio
Downloading master.zip from https://github.com/rstudio/packrat/archive/master.zip
Installing package from C:\Users\RAPPST~1\AppData\Local\Temp\RtmpCaiyWW/master.zip
Error in unzip(src, list = TRUE) : 
zip file 'C:\Users\RAPPST~1\AppData\Local\Temp\RtmpCaiyWW/master.zip' cannot be opened
In addition: Warning messages:
1: In mapCurlOptNames(names(.els), asNames = TRUE) :
  Unrecognized CURL options: writedata
2: In mapCurlOptNames(names(.els), asNames = TRUE) :
  Unrecognized CURL options: writedata
3: In unzip(src, exdir = target, unzip = getOption("unzip")) :
  error 1 in extracting from zip file

At first I thought, that my Rtools might not be recognized correctly (zip/unzip), but the tools are attached to my path and I can access them:

> system("unzip")
UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.
[...]

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
@hadley
Copy link
Member

hadley commented Jul 29, 2014

When does it crash?

@jankowtf
Copy link
Author

When I run install_github() from R.exe, Rterm.exe, RStudio and via Eclipse/StatET, it crashes. When running it via Rgui.exe, I get the above error, but the console stays "alive".

@jankowtf
Copy link
Author

I tried to narrow things down a bit:

  1. Tested on a different machine with identical settings, same result.
  2. On that other machine, tested with an old installation of R-3.1.0 and thus (possibly) old versions of devtools' package dependencies (I'll have to check that in more detail; the version of devtools itself already was at 1.5 anyway) and everything worked just fine.
  3. On that other machine, tested with a new installation of R-3.1.0 and thus latest dependency versions and it failed again.

In all three cases, I used the Rtools 3.1.

So I'm guessing, that it has to do with some package that devtools depends on?

@jankowtf
Copy link
Author

Okay, I think I got it narrowed down to being a problem with RCurl version 1.95-4.1 (working) vs. 1.95-4.2 (not working).

Starting from my old installation of R-3.1.0, the only package that devtools depends on and that changed until today is RCurl. After upgrading to version 1.95-4.2, install_github() fails (see details below).

HTH,
Janko


## Functions //
getCurrentLibraryState <- function() {
  pkgs <- list.files(R.home("library"))
  vsns <- sapply(pkgs, packageDescription, field="Version")
  vsns[order(names(vsns))]
}
getRepositoryState <- function() {
  vsns <- available.packages()[,"Version"]
  vsns <- vsns[which(names(vsns) %in% list.files(R.home("library")))]
  vsns[order(names(vsns))]
}
getVersionDifferences <- function(vsns) {
  sapply(1:nrow(vsns), function(ii) {
    vsns[ii,1] != vsns[ii,2]
  })
}

## Version overview //
repos <- getRepositoryState()
local <- getCurrentLibraryState()[names(repos)]
vsns <- data.frame(
  local=local,
  repos=repos,
  stringsAsFactors=FALSE
)
vsns$changed <- getVersionDifferences(vsns=vsns)

The only dependency for which a new version is available for R-3.1.0 is package RCurl:

## Devtools dependencies //
deps <- packageDescription("devtools", field="Imports")
deps <- unlist(strsplit(gsub("\\s|\\(.*\\)|\\n", "", deps), split=","))
vsns_2 <- vsns[which(rownames(vsns) %in% deps), ]
> vsns_2
            local    repos changed
digest      0.6.4    0.6.4   FALSE
evaluate    0.5.5    0.5.5   FALSE
httr          0.3      0.3   FALSE
memoise     0.2.1    0.2.1   FALSE
RCurl    1.95-4.1 1.95-4.2    TRUE
whisker     0.3-2    0.3-2   FALSE

Before updating RCurl, everything still works fine:

> require("devtools")
> install_github("rstudio/packrat")
Installing github repo packrat/master from rstudio
Downloading master.zip from https://github.com/rstudio/packrat/archive/master.zip
Installing package from C:\Users\rappster\AppData\Local\Temp\RtmpQT0Exb/master.zip
Installing packrat
"C:/home/apps/r/R-31~1.0/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\rappster\AppData\Local\Temp\RtmpQT0Exb\devtools10c0124774a9\packrat-master"  \
  --library="C:/home/apps/r/R-3.1.0/library" --install-tests 

* installing *source* package 'packrat' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (packrat)

After the update, the whole thing fails:

> install.packages("RCurl")
--- Please select a CRAN mirror for use in this session ---

  There is a binary version available (and will be installed) but the source version is later:
        binary   source
RCurl 1.95-4.2 1.95-4.3

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/RCurl_1.95-4.2.zip'
Content type 'application/zip' length 2835598 bytes (2.7 Mb)
opened URL
downloaded 2.7 Mb

package ‘RCurl’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\rappster\AppData\Local\Temp\RtmpYJd16m\downloaded_packages
> packageDescription("RCurl", field="Version")
[1] "1.95-4.2"

> require("devtools")
Loading required package: devtools

Attaching package: ‘devtools’

The following objects are masked from ‘package:utils’:

    ?, help

The following object is masked from ‘package:base’:

    system.file

> install_github("rstudio/packrat")
Installing github repo packrat/master from rstudio
Downloading master.zip from https://github.com/rstudio/packrat/archive/master.zip
Installing package from C:\Users\rappster\AppData\Local\Temp\RtmpYJd16m/master.zip
Error in unzip(src, list = TRUE) : 
  zip file 'C:\Users\rappster\AppData\Local\Temp\RtmpYJd16m/master.zip' cannot be opened
In addition: Warning messages:
1: In mapCurlOptNames(names(.els), asNames = TRUE) :
  Unrecognized CURL options: writedata
2: In mapCurlOptNames(names(.els), asNames = TRUE) :
  Unrecognized CURL options: writedata
3: In unzip(src, exdir = target, unzip = getOption("unzip")) :
  error 1 in extracting from zip file

@hadley
Copy link
Member

hadley commented Jul 29, 2014

Maybe try 1.95-4.3? It looks like that was just released - I suspect that was a quick fix for the problem you're seeing in .2.

@jankowtf
Copy link
Author

I would like to, but compiling RCurl from source on Windows seems to be a bit tricky with respect to libcurl and its companion DLLs. I gues I'm stuck until the Windows binary for v.1.95-4.3 comes out.

@dacorea1
Copy link

Hey there Rappster. I'm actually experiencing the same issue you've been troubleshooting today. I just had to update all my R packages today, leaving me with an RCurl installation that crashes my R session every time I need to use devtools. Seeing as how it's nearing the end of my day, I thought I'd make my way to Stack Overflow, only to find that you already posted this issue there. 👍

Thanks so much for going through the trouble to uncover this troublesome package. I'll let you know if I make any progress on my end, and I'll keep an eye out to see you if make any as well.

@geneorama
Copy link

For what it's worth, I found a workaround that works for me;

  1. Clone the project that you want to install (I'm assuming this project is an R Package, like devtools)
  2. Start a new R Studio project in that project folder
  3. Click on the "build" tab
  4. Click on the "Build & Reload" button.

The package should be installed.

@dacorea1
Copy link

Rappster and Hadley,

Thanks for both of your efforts in understanding this bug. CRAN now has a binary file for v.1.95-4.3 of RCurl hosted on its site.

After downloading it, and building it from source, I have a working version of RCurl on my windows machine again.

@hadley hadley closed this as completed Jul 30, 2014
@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants