X Tutup
The Wayback Machine - https://web.archive.org/web/20200529202202/https://github.com/cli/cli/issues/1003
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

After updating from release 0.54 to 0.9 I get a 401 Bad credentials problem #1003

Open
martinilevi opened this issue May 26, 2020 · 4 comments
Open

Comments

@martinilevi
Copy link

@martinilevi martinilevi commented May 26, 2020

Describe the bug

I can clone a repo without a problem but gh seems to return a credentials problem.

Steps to reproduce the behavior

  1. Clone a repository with git clone
  2. Change to the created folder
  3. Type "gh checkout pr 1"
  4. I see:
    http error, 'https://api.github.com/graphql' failed (401): 'Bad credentials'

Expected vs actual behavior

I expect the PR #1 branch to be checked out

Logs

$ cd tmp
/tmp$ rm -Rf bin
/tmp$ git clone git@github.com:martinilevi/bin.git
Cloning into 'bin'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 85 (delta 0), reused 2 (delta 0), pack-reused 82
Receiving objects: 100% (85/85), 190.95 KiB | 406.00 KiB/s, done.
Resolving deltas: 100% (34/34), done.
/tmp$ cd bin/
/tmp/bin(master)$ gh pr checkout 1
http error, 'https://api.github.com/graphql' failed (401): 'Bad credentials'
/tmp/bin(master)$ gh --version
gh version 0.9.0 (2020-05-26)
https://github.com/cli/cli/releases/tag/v0.9.0

@martinilevi martinilevi added the bug label May 26, 2020
@billygriffin
Copy link
Member

@billygriffin billygriffin commented May 26, 2020

Thanks for the issue @martinilevi and sorry you're having difficulty after upgrading. How did you install gh?

I'm not sure what in the upgrade might've caused this, but if you want to get back to using it immediately, you can force re-authentication by deleting ~/.config/gh/config.yml and then running any command.

@manwaring
Copy link

@manwaring manwaring commented May 27, 2020

I'm having a similar issue - installed 0.9 from gh_0.9.0_linux_amd64.deb. When I try to clone a repo and am prompted to login via the browser:

  • The browser shows me the permissions page, then a success page after I authorize
  • In the terminal gh asks for my username and password, after supplying them it indicates 'invalid username or password'

Update: I believe the issue was caused by my use of MFA, when I created a new access token for the password prompt in the terminal everything started working

@vilmibm
Copy link
Member

@vilmibm vilmibm commented May 27, 2020

fwiw, gh itself will never ask for a username and password--when that happens it's git under the hood trying to authenticate.

@mislav
Copy link
Member

@mislav mislav commented May 27, 2020

@martinilevi Let us know if re-authenticating by deleting the config file worked! We plan to improve the user experience around getting the 401 error #627, but for now manual reauthentication is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.
X Tutup