-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinggh-authrelating to the gh auth commandrelating to the gh auth commandhelp wantedContributions welcomeContributions welcomep3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
Describe the bug
Connect timeout is incorrectly reported as invalid token
Steps to reproduce the behavior
- Authenticate to a GHE host (eg:
ghe.mycorp.org) on the VPN, then disconnect from the VPN - Note that the connection now times out, eg:
❯ curl --connect-timeout 5 https://ghe.mycorp.org curl: (28) Failed to connect to ghe.mycorp.org port 443 after 2005 ms: Timeout was reached - Check auth status, eg:
❯ gh auth status -h ghe.mycorp.org ghe.mycorp.org X ghe.mycorp.org: authentication failed - The ghe.mycorp.org token in keyring is invalid. - To re-authenticate, run: gh auth login -h ghe.mycorp.org - To forget about this host, run: gh auth logout -h ghe.mycorp.org
Expected vs actual behavior
Connection timeouts should be reported as connection timeout rather than an invalid token. An invalid token suggests reauthentication is required, when the solution is to resolve the connection timeout (eg: by connecting to the VPN).
Logs
❯ gh --version
gh version 2.38.0 (2023-11-01)
https://github.com/cli/cli/releases/tag/v2.38.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggh-authrelating to the gh auth commandrelating to the gh auth commandhelp wantedContributions welcomeContributions welcomep3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic