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

more informative error messages for update_packages() #223

Closed
dpprdan opened this issue Oct 25, 2018 · 9 comments
Closed

more informative error messages for update_packages() #223

dpprdan opened this issue Oct 25, 2018 · 9 comments

Comments

@dpprdan
Copy link
Contributor

dpprdan commented Oct 25, 2018

I encountered the following error message from update_packages() today.

library(remotes)
update_packages()
#> Error: HTTP error 422.
#>   No commit found for SHA: patch-1
#> 
#>   Rate limit remaining: 4992/5000
#>   Rate limit reset at: 2018-10-25 17:37:08 UTC
#> 
#> 

I had no idea what (package) might have caused this, but subsequently narrowed it down to a package, which I installed at the time from a now deleted Github branch.

update_packages("remedy")
#> Error: HTTP error 422.
#>   No commit found for SHA: patch-1
#> 
#>   Rate limit remaining: 4991/5000
#>   Rate limit reset at: 2018-10-25 17:37:08 UTC
#> 
#> 

desc::desc(system.file("DESCRIPTION", package = "remedy"))
#> Package: remedy
#> Title: RStudio Addins to Simplify Markdown Writing
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#>     * Colin Fay <[email protected]> [aut, cre]
#> Author: Colin Fay [aut, cre]
#> Maintainer: Colin Fay <[email protected]>
#> Description: An RStudio addin providing shortcut for writing in Markdown.
#> License: MIT + file LICENSE
#> Imports:
#>     rstudioapi,
#>     stringr
#> Built: R 3.4.1; ; 2017-09-09 12:43:25 UTC; windows
#> Encoding: UTF-8
#> GithubRef: patch-1
#> GithubRepo: remedy
#> GithubSHA1: ab59c3510b64dfc6efe3293bd7d16d8cea69ae46
#> GithubUsername: dpprdan
#> LazyData: true
#> RemoteHost: https://api.github.com
#> RemoteRef: patch-1
#> RemoteRepo: remedy
#> RemoteSha: ab59c3510b64dfc6efe3293bd7d16d8cea69ae46
#> RemoteType: github
#> RemoteUsername: dpprdan
#> RoxygenNote: 6.0.1.9000

Now maybe this particular case is a very rare one but nevertheless I think it might be helpful to get more informative (error) messages if update_packages() fails (e.g. which package caused the error), so the user knows better, where to look.

Session info
devtools::session_info()
#> - Session info ----------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.5.1 (2018-07-02)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language EN                          
#>  collate  German_Germany.1252         
#>  ctype    German_Germany.1252         
#>  tz       Europe/Berlin               
#>  date     2018-10-25                  
#> 
#> - Packages --------------------------------------------------------------
#>  package     * version date       lib source        
#>  assertthat    0.2.0   2017-04-11 [1] CRAN (R 3.5.1)
#>  backports     1.1.2   2017-12-13 [1] CRAN (R 3.5.0)
#>  base64enc     0.1-3   2015-07-28 [1] CRAN (R 3.5.0)
#>  callr         3.0.0   2018-08-24 [1] CRAN (R 3.5.1)
#>  cli           1.0.1   2018-09-25 [1] CRAN (R 3.5.1)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.1)
#>  curl          3.2     2018-03-28 [1] CRAN (R 3.5.1)
#>  debugme       1.1.0   2017-10-22 [1] CRAN (R 3.5.1)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.5.1)
#>  devtools      2.0.0   2018-10-19 [1] CRAN (R 3.5.1)
#>  digest        0.6.18  2018-10-10 [1] CRAN (R 3.5.1)
#>  evaluate      0.12    2018-10-09 [1] CRAN (R 3.5.1)
#>  fs            1.2.6   2018-08-23 [1] CRAN (R 3.5.1)
#>  glue          1.3.0   2018-07-17 [1] CRAN (R 3.5.1)
#>  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.5.1)
#>  knitr         1.20    2018-02-20 [1] CRAN (R 3.5.1)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.1)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.1)
#>  pkgbuild      1.0.2   2018-10-16 [1] CRAN (R 3.5.1)
#>  pkgload       1.0.1   2018-10-11 [1] CRAN (R 3.5.1)
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.1)
#>  processx      3.2.0   2018-08-16 [1] CRAN (R 3.5.1)
#>  ps            1.2.0   2018-10-16 [1] CRAN (R 3.5.1)
#>  R6            2.3.0   2018-10-04 [1] CRAN (R 3.5.1)
#>  Rcpp          0.12.19 2018-10-01 [1] CRAN (R 3.5.1)
#>  remotes     * 2.0.1   2018-10-19 [1] CRAN (R 3.5.1)
#>  rlang         0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1)
#>  rmarkdown     1.10    2018-06-11 [1] CRAN (R 3.5.1)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.1)
#>  sessioninfo   1.1.0   2018-09-25 [1] CRAN (R 3.5.1)
#>  stringi       1.2.4   2018-07-20 [1] CRAN (R 3.5.1)
#>  stringr       1.3.1   2018-05-10 [1] CRAN (R 3.5.1)
#>  testthat      2.0.1   2018-10-13 [1] CRAN (R 3.5.1)
#>  usethis       1.4.0   2018-08-14 [1] CRAN (R 3.5.1)
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.1)
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.5.1)
#> 
#> [1] D:/Users/Daniel/Documents/R/win-library/3.5
#> [2] C:/Program Files/R/R-3.5.1/library
@infotroph
Copy link
Contributor

infotroph commented Nov 1, 2018

+1. Just encountered this in the even less informative case where I hadn't yet installed from the bad remote, so I didn't even have a sha to work from. To reproduce:

totally_a_package <- tempfile()
dir.create(totally_a_package)
write.dcf(
    list(Imports = "remotes, fakePkg", Remotes = "r-lib/remotes, infotroph/faekPgk"),
    file.path(totally_a_package, "DESCRIPTION"))
remotes::install_deps(totally_a_package)

Result:

Error: HTTP error 404.
  Not Found

  Rate limit remaining: 59/60
  Rate limit reset at: 2018-11-01 02:10:30 UTC

@dpprdan
Copy link
Contributor Author

dpprdan commented Nov 2, 2018

Yet another 🤦‍♂️ that could potentially use a better error message.

remotes::update_packages("remedy")
#> Skipping 1 packages not available: remedy

Huh? But I know that {remedy} is installed.

sessioninfo::package_info("remedy")
#>  package    * version    date       lib source                           
#>  assertthat   0.2.0      2017-04-11 [1] CRAN (R 3.5.1)                   
#>  cli          1.0.1      2018-09-25 [1] CRAN (R 3.5.1)                   
#>  crayon       1.3.4      2017-09-16 [1] CRAN (R 3.5.1)                   
#>  evaluate     0.12       2018-10-09 [1] CRAN (R 3.5.1)                   
#>  fansi        0.4.0      2018-10-05 [1] CRAN (R 3.5.1)                   
#>  glue         1.3.0      2018-07-17 [1] CRAN (R 3.5.1)                   
#>  highr        0.7        2018-06-09 [1] CRAN (R 3.5.1)                   
#>  jsonlite     1.5        2017-06-01 [1] CRAN (R 3.5.1)                   
#>  knitr        1.20       2018-02-20 [1] CRAN (R 3.5.1)                   
#>  magrittr     1.5        2014-11-22 [1] CRAN (R 3.5.1)                   
#>  markdown     0.8        2017-04-20 [1] CRAN (R 3.5.1)                   
#>  mime         0.6        2018-10-05 [1] CRAN (R 3.5.1)                   
#>  pillar       1.3.0.9000 2018-08-16 [1] Github (hadley/colformat@3fabb4e)
#>  rematch2     2.0.1      2017-06-20 [1] CRAN (R 3.5.1)                   
#>  remedy       0.0.0.9800 2018-09-17 [1] local                            
#>  rlang        0.3.0.1    2018-10-25 [1] CRAN (R 3.5.1)                   
#>  rstudioapi   0.8        2018-10-02 [1] CRAN (R 3.5.1)                   
#>  stringi      1.2.4      2018-07-20 [1] CRAN (R 3.5.1)                   
#>  stringr      1.3.1      2018-05-10 [1] CRAN (R 3.5.1)                   
#>  tibble       1.4.2      2018-01-22 [1] CRAN (R 3.5.1)                   
#>  utf8         1.1.4      2018-05-24 [1] CRAN (R 3.5.1)                   
#>  yaml         2.2.0      2018-07-25 [1] CRAN (R 3.5.1)                   
#> 
#> [1] C:/Users/daniel/Documents/.R/win-library
#> [2] C:/Program Files/R/R-3.5.1/library

Oh, so apparently I installed it from my local repo.

@gaborcsardi
Copy link
Member

@dpprdan that's not an error message, it is just a message.

@dpprdan
Copy link
Contributor Author

dpprdan commented Nov 2, 2018

@gaborcsardi True, I've updated my post.

@japilo
Copy link

japilo commented Jan 24, 2019

I am getting the same error message, in my case for the package ggmap.

Downloading GitHub repo dkahle/ggmap@master
Error: HTTP error 422.
  No commit found for SHA: rc-0.3.1

  Rate limit remaining: 4973/5000
  Rate limit reset at: 2019-01-24 12:23:35 UTC

@artemklevtsov
Copy link

artemklevtsov commented Jan 28, 2019

There is issue for this: #274

@prosoitos
Copy link

prosoitos commented Jun 20, 2019

Had the same problem for the package nlmr:

Error: HTTP error 422.
  No commit found for SHA: develop

  Rate limit remaining: 4891/5000
  Rate limit reset at: 2019-06-20 04:45:50 UTC

Since it was my very first time using remotes::update_packages() and since I had left a lot of my packages installed from GitHub get out of date, it took a while to narrow it down.

Side note: this is a really great function. Thank you!

@prosoitos
Copy link

prosoitos commented Jun 20, 2019

While trying to narrow it down, I also noticed that update_packages() seems to accept vectors only up to a certain length (maybe about 150 elements, maybe a little more). For longer vectors, even without missing any parenthesis, R would not run as show + on the next line as if the function was incomplete (I did try it several times and made really sure that I was not missing a closing parenthesis).

@prosoitos
Copy link

Oh, this is great! Thank you @jimhester for the change!

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

6 participants