-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsp2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
Describe the bug
Immediately after boot, any attempt to use the gh cli commands fails as unauthorized. Any second attempt always works. This is because gh tries to use hosts.yml initiallity for authorization, and it says the (nonexistent) token is invalid. On second attempts it correctly looks in the system keyring, finds the credentials, and succeeds.
gh version 2.45.0 (1980-01-01)
https://github.com/cli/cli/releases/tag/v2.45.0
OS: NixOS 24.05
DE: KDE Plasma 6.0.1
Steps to reproduce the behavior
- Boot system
- Run
gh auth statusonce:
❯ gh auth status
github.com
X Failed to log in to github.com account XXXXXXX (/home/XXXXXXX/.config/gh/hosts.yml)
- Active account: true
- The token in /home/XXXXXXX/.config/gh/hosts.yml is invalid.
- To re-authenticate, run: gh auth login -h github.com
- To forget about this account, run: gh auth logout -h github.com -u tdhooten
- Run
gh auth statusagain:
❯ gh auth status
github.com
✓ Logged in to github.com account XXXXXXX (keyring)
- Active account: true
- Git operations protocol: https
- Token: gho_************************************
- Token scopes: 'gist', 'read:org', 'repo', 'workflow'
Expected vs actual behavior
Expected: it should work the first time.
Actual: it only works the second time.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsp2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions