Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAfter updating from release 0.54 to 0.9 I get a 401 Bad credentials problem #1003
Comments
|
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. |
|
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:
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 |
|
fwiw, gh itself will never ask for a username and password--when that happens it's git under the hood trying to authenticate. |
|
@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. |


Describe the bug
I can clone a repo without a problem but gh seems to return a credentials problem.
Steps to reproduce the behavior
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