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

install_github returns Bad credentials error #1566

Closed
kanasethu opened this issue Aug 6, 2017 · 2 comments
Closed

install_github returns Bad credentials error #1566

kanasethu opened this issue Aug 6, 2017 · 2 comments

Comments

@kanasethu
Copy link

install_github("StatsWithR/statsr")
Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo StatsWithR/statsr@master
from URL https://api.github.com/repos/StatsWithR/statsr/zipball/master
Installation failed: Bad credentials (401)

and FYI

devtools::session_info()
Session info -------------------------------------------------------------------
setting value
version R version 3.4.0 (2017-04-21)
system x86_64, darwin15.6.0
ui RStudio (1.0.153)
language (EN)
collate en_US.UTF-8
tz America/New_York
date 2017-08-06

Packages -----------------------------------------------------------------------
package * version date source
base * 3.4.0 2017-04-21 local
compiler 3.4.0 2017-04-21 local
curl 2.6 2017-04-27 CRAN (R 3.4.0)
datasets * 3.4.0 2017-04-21 local
devtools * 1.13.3 2017-08-02 CRAN (R 3.4.1)
digest 0.6.12 2017-01-27 CRAN (R 3.4.0)
git2r 0.18.0 2017-01-01 CRAN (R 3.4.0)
graphics * 3.4.0 2017-04-21 local
grDevices * 3.4.0 2017-04-21 local
httr 1.2.1 2016-07-03 CRAN (R 3.4.0)
jsonlite 1.5 2017-06-01 CRAN (R 3.4.0)
memoise 1.1.0 2017-04-21 CRAN (R 3.4.0)
methods * 3.4.0 2017-04-21 local
R6 2.2.2 2017-06-17 CRAN (R 3.4.0)
stats * 3.4.0 2017-04-21 local
tools 3.4.0 2017-04-21 local
utils * 3.4.0 2017-04-21 local
withr 1.0.2 2016-06-20 CRAN (R 3.4.0)

@kanasethu
Copy link
Author

Issue resolved. Looked through the install_github code. Not sure where, why or how a GITHUB_PAT was set in my R environment! Unsetting it worked fine.

> install_github("StatsWithR/statsr")
Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo StatsWithR/statsr@master
from URL https://api.github.com/repos/StatsWithR/statsr/zipball/master
Installation failed: Bad credentials (401)

> install_github
function (repo, username = NULL, ref = "master", subdir = NULL,
auth_token = github_pat(quiet), host = "https://api.github.com",
quiet = FALSE, ...)
      <Snip - snip>
}
<environment: namespace:devtools>

> github_pat(1)
[1] "bf<snip><snip>88"

> github_pat

function (quiet = FALSE)
{
pat <- Sys.getenv("GITHUB_PAT")
   <snip - snip>
return(NULL)
}
<environment: namespace:devtools>

> Sys.getenv("GITHUB_PAT")
[1] "bf<snip><snip>88"

> Sys.unsetenv("GITHUB_PAT")
> Sys.getenv("GITHUB_PAT")

[1] ""

> install_github("StatsWithR/statsr")
Downloading GitHub repo StatsWithR/statsr@master
from URL https://api.github.com/repos/StatsWithR/statsr/zipball/master
Installing statsr                     <<< Bob's your uncle

@lock
Copy link

lock bot commented Sep 17, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 17, 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

1 participant