Error Failed to install 'unknown package' from GitHub Bad credentials Rate limit

Hi everyone,

Even after reading extensively in several GitHub pages I still don't know how to solve this error:

Error: Failed to install 'unknown package' from GitHub: HTTP error 401. Bad credentials Rate limit remaining: 55/60 Rate limit reset at: 2021-08-25 08:50:24 UTC

For your information:

> devtools::session_info()
─ Session info ───────────────────────────────────────────────────
 setting  value                       
 version  R version 4.1.1 (2021-08-10)
 os       macOS Big Sur 11.4          
 system   x86_64, darwin17.0          
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Europe/Amsterdam            
 date     2021-08-25                  

─ Packages ───────────────────────────────────────────────────────
 package     * version date       lib source        
 cachem        1.0.6   2021-08-19 [1] CRAN (R 4.1.0)
 callr         3.7.0   2021-04-20 [1] CRAN (R 4.1.0)
 cli           3.0.1   2021-07-17 [1] CRAN (R 4.1.0)
 colorspace    2.0-2   2021-06-24 [1] CRAN (R 4.1.0)
 crayon        1.4.1   2021-02-08 [1] CRAN (R 4.1.0)
 curl          4.3.2   2021-06-23 [1] CRAN (R 4.1.0)
 desc          1.3.0   2021-03-05 [1] CRAN (R 4.1.0)
 devtools    * 2.4.2   2021-06-07 [1] CRAN (R 4.1.0)
 digest        0.6.27  2020-10-24 [1] CRAN (R 4.1.0)
 distill     * 1.2     2021-01-13 [1] CRAN (R 4.1.0)
 downlit       0.2.1   2020-11-04 [1] CRAN (R 4.1.0)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.1.0)
 evaluate      0.14    2019-05-28 [1] CRAN (R 4.1.0)
 fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.1.0)
 fs            1.5.0   2020-07-31 [1] CRAN (R 4.1.0)
 glue          1.4.2   2020-08-27 [1] CRAN (R 4.1.0)
 gtable      * 0.3.0   2019-03-25 [1] CRAN (R 4.1.0)
 here        * 1.0.1   2020-12-13 [1] CRAN (R 4.1.0)
 htmltools     0.5.1.1 2021-01-22 [1] CRAN (R 4.1.0)
 knitr         1.33    2021-04-24 [1] CRAN (R 4.1.0)
 lifecycle     1.0.0   2021-02-15 [1] CRAN (R 4.1.0)
 magrittr      2.0.1   2020-11-17 [1] CRAN (R 4.1.0)
 memoise       2.0.0   2021-01-26 [1] CRAN (R 4.1.0)
 munsell     * 0.5.0   2018-06-12 [1] CRAN (R 4.1.0)
 pkgbuild      1.2.0   2020-12-15 [1] CRAN (R 4.1.0)
 pkgload       1.2.1   2021-04-06 [1] CRAN (R 4.1.0)
 prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.1.0)
 processx      3.5.2   2021-04-30 [1] CRAN (R 4.1.0)
 ps            1.6.0   2021-02-28 [1] CRAN (R 4.1.0)
 purrr         0.3.4   2020-04-17 [1] CRAN (R 4.1.0)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.1.0)
 remotes       2.4.0   2021-06-02 [1] CRAN (R 4.1.0)
 rlang         0.4.11  2021-04-30 [1] CRAN (R 4.1.0)
 rmarkdown   * 2.10    2021-08-06 [1] CRAN (R 4.1.0)
 rprojroot     2.0.2   2020-11-15 [1] CRAN (R 4.1.0)
 rsconnect     0.8.24  2021-08-05 [1] CRAN (R 4.1.0)
 sessioninfo * 1.1.1   2018-11-05 [1] CRAN (R 4.1.0)
 stringi       1.7.3   2021-07-16 [1] CRAN (R 4.1.0)
 stringr     * 1.4.0   2019-02-10 [1] CRAN (R 4.1.0)
 testthat      3.0.4   2021-07-01 [1] CRAN (R 4.1.0)
 usethis     * 2.0.1   2021-02-10 [1] CRAN (R 4.1.0)
 withr         2.4.2   2021-04-18 [1] CRAN (R 4.1.0)
 xfun          0.25    2021-08-06 [1] CRAN (R 4.1.0)
 yaml          2.2.1   2020-02-01 [1] CRAN (R 4.1.0)
[1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library
> install_github("peetmate/ERAg")
Error: Failed to install 'unknown package' from GitHub:
  HTTP error 404.
  Not Found

..later on I now have exceeded the Rate limit.. What do I do to proceed here please..?

after trying again, and again, and again, I realised it might even be related to my GithHub API access and the GITHUB_PAT ? As I get this message

Error: Failed to install 'unknown package' from GitHub:
  HTTP error 401.
  Bad credentials
  Rate limit remaining: 0/60
  Rate limit reset at: 2021-08-25 08:50:24 UTC
  To increase your GitHub API rate limit
  - Use `usethis::browse_github_pat()` to create a Personal Access Token.
  - Use `usethis::edit_r_environ()` and add the token as `GITHUB_PAT`.

If you are trying to install a private package you need to setup a personal access token (PAT) that has access to the private repository to install it.

As the error message indicates use usethis::browse_github_pat() to create an access token and add it to your R environment file as GITHUB_PAT=xyz using usethis::edit_r_environ()

3 Likes

Hi @jimhester and others following this thread.

In the end I asked the owner of the private GitHub repo to generate a new auth_token and this worked! Thank you for your help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.