I've encountered a persistent issue when trying to fetch Go modules, specifically experiencing network timeouts when my Go tools attempt to access proxy.golang.org. Despite successful ping and curl operations to golang.org and having basic network connectivity confirmed, go get fails with a timeout error. I'm reaching out for insights or solutions you might have based on the detailed context and troubleshooting steps I've already taken.
Environment:
Go version: go1.22.1 linux/amd64
OS: Archlinux
Network: Home
Symptoms:
Running go get -v golang.org/x/[email protected] results in a timeout error with the message:
go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/sys/@v/v0.18.0.info": dial tcp: lookup proxy.golang.org: i/o timeout
However, ping golang.org and curl -I https://golang.org are successful, indicating basic network and DNS functionality.
Troubleshooting Steps Taken:
Network Checks: Confirmed that ping and curl to golang.org work without issues.
DNS Checks: Installed dnsutils and successfully resolved golang.org using nslookup.
Go Environment Variables: Reviewed go env outputs, with GOPROXY initially set to direct and then tried https://proxy.golang.org without resolving the issue.
Firewall/Proxy Configuration: Ensured no HTTP/HTTPS proxy is set and no relevant firewall rules are blocking the connection. Unset HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables for testing.
Verbose Go Get: Used go get -v -x for more verbose output, which confirmed the tool is attempting to fetch from proxy.golang.org but times out.
Questions:
DNS or Network Configuration: Is there a known issue with Go tools that might cause DNS resolution or network requests to behave differently than other tools like ping and curl?
Go Proxy Settings: Are there additional configurations or environment variables I should consider to ensure Go can fetch modules without encountering a network timeout?
Diagnostic Tools or Logs: Are there other diagnostic tools or logs within the Go ecosystem that could provide more insight into what might be causing these timeouts?
Community Experiences: Has anyone else encountered similar issues accessing proxy.golang.org, especially in environments without explicit proxy configurations?
I appreciate any insights, suggestions, or shared experiences you might have that could help resolve this fetching issue. Thank you in advance for your time and help!