You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
failed to authenticate via web browser: Post "https://github.com/login/device/code": dial tcp 20.205.243.166:443: i/o timeout
Interesting. There's not anything particularly surprising going on here, it's just sending an http request to github.com.
A couple of interesting things, can you share the output of GH_DEBUG=api gh auth login making sure to retract any tokens for example the line: device_code=XYX&expires_in=899&interval=5&user_code=XYZ&verification_uri=https%3A%2F%2Fgithub.com%2Flogin%2Fdevice
Can you tell me what happens if you curl this endpoint e.g:
curl -X POST https://github.com/login/device/code
GH_DEBUG=api gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
[git config credential.https://github.com.helper]
[git config credential.helper]
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
* Request at 2024-01-26 11:00:09.469224122 +0800 CST m=+43.911681202
* Request to https://github.com/login/device/code
> POST /login/device/code HTTP/1.1
> Host: github.com
> Content-Length: 66
> Content-Type: application/x-www-form-urlencoded
client_id=178c6fc778ccc68e1d6a&scope=repo+read%3Aorg+gist+workflow
* dial tcp 20.205.243.166:443: i/o timeout
* Request took 30.076320655s
failed to authenticate via web browser: Post "https://github.com/login/device/code": dial tcp 20.205.243.166:443: i/o timeout
the output of curl:
curl -X POST https://github.com/login/device/code
curl: (28) Failed to connect to github.com port 443 after 129420 ms: Couldn't connect to server
BTW...When I open https://github.com/login/device/code using the browser, the page shows error code 404.
* Host github.com:443 was resolved.
* IPv6: (none)
* IPv4: 20.205.243.166
* Trying 20.205.243.166:443...
* connect to 20.205.243.166 port 443 from 192.168.1.3 port 59074 failed: Connection timed out
* Failed to connect to github.com port 443 after 129054 ms: Couldn't connect to server
* Closing connection
curl: (28) Failed to connect to github.com port 443 after 129054 ms: Couldn't connect to server
It seems that you have some connectivity issue between your terminal and github. Perhaps you have some kind of firewall preventing connections from the terminal (though I'd be surprised that DNS seems to work). Maybe your browser is set up to work through an HTTP_PROXY and your terminal isn't?
Do you have any kind of connectivity from your terminal e.g.
Activity
williammartin commentedon Jan 25, 2024
Does this consistently fail? It looks like a connectivity issue between you and github.com?
bye-byte commentedon Jan 25, 2024
Yes, it keeps failing. I can access github using firefox. @williammartin
williammartin commentedon Jan 25, 2024
Interesting. There's not anything particularly surprising going on here, it's just sending an http request to github.com.
A couple of interesting things, can you share the output of
GH_DEBUG=api gh auth loginmaking sure to retract any tokens for example the line:device_code=XYX&expires_in=899&interval=5&user_code=XYZ&verification_uri=https%3A%2F%2Fgithub.com%2Flogin%2FdeviceCan you tell me what happens if you curl this endpoint e.g:
Does it also timeout?
bye-byte commentedon Jan 26, 2024
the output of GH_DEBUG=api gh auth login:the output of curl:@williammartin
bye-byte commentedon Jan 26, 2024
BTW...When I open
https://github.com/login/device/codeusing the browser, the page shows error code 404.williammartin commentedon Jan 26, 2024
Yes I don't believe that endpoint serves
GETrequests so that wouldn't be surprising.What happens if you:
bye-byte commentedon Jan 26, 2024
curl -vvv https://github.com/login/device/code output:williammartin commentedon Jan 26, 2024
It seems that you have some connectivity issue between your terminal and github. Perhaps you have some kind of firewall preventing connections from the terminal (though I'd be surprised that DNS seems to work). Maybe your browser is set up to work through an
HTTP_PROXYand your terminal isn't?Do you have any kind of connectivity from your terminal e.g.
or
bye-byte commentedon Jan 26, 2024
Ohhh,i see.I need set
http_proxyin terminal.I can't access github smoothly without a proxy, so my network proxy is on.I need to set the proxy separately in the terminal.
I have successfully authenticated. Thank you very much!
williammartin commentedon Jan 26, 2024
No problem glad I could help.