I have been using gcloud cli for last 3months on my system, but now I start facing this error while authenticating with gcloud auth login
or gcloud init --console-only
.
After debugging it, I see some issue with the DNS resolution for oauth2.googleapis.com
Below is the result when trying to ping oauth2.googleapis.com:
PING dotblocking.dummy (13.127.247.216): 56 data bytes (My ISP seems to redirecting it to dotblocking.dummy) Request timeout for icmp_seq 0 Request timeout for icmp_seq 1
Hope you use Airtel broadband. Airtel ISP is the problem. Because of the recent outage issue they had last week. Use CloudFlare or VPN to resolve the issue.
Reference
https://stackoverflow.com/questions/68836901/gcp-cloud-sql-proxy-times-out-connectex
Change you DNS servers to Google ones. Clear your DNS cache first