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
Describe the bug
Connect timeout is incorrectly reported as invalid token
Steps to reproduce the behavior
ghe.mycorp.org) on the VPN, then disconnect from the VPNExpected 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