Open ForestJohnson opened 2 years ago
Wait hang on i got confused, hold the phone,
71,34,5,123
IS the right address from /etc/hosts, and thats what the name lookup appears to be returning,
but i'm still seeing https fetch: Get "https://git.sequentialread.com/forest/config-lite?go-get=1": dial tcp 71.34.16.185:443: connect: connection refused
error log at the end of the very same debug session
OK, so whatever I was looking at before appears to not be related to the actual problem.
forest@thingpad:~/Desktop/git/go/src/cmd/go$ cat delve-init
break /usr/local/go/src/net/http/transport.go:1605
condition 1 pconn.cacheKey.addr == "git.sequentialread.com:443" && conn.conn.fd.raddr.IP[3] == 185
continue
forest@thingpad:~/Desktop/git/go/src/cmd/go$ /home/forest/go/bin/dlv debug --init delve-init -- get git.sequentialread.com/forest/config-lite
2022-02-13T16:02:25-06:00 error layer=debugger can't find build-id note on binary
Type 'help' for list of commands.
Breakpoint 1 set at 0x89f345 for net/http.(*Transport).dialConn() /usr/local/go/src/net/http/transport.go:1605
go: downloading git.sequentialread.com/forest/config-lite v0.0.0-20220122212408-4941a7aa3dc0
go get: git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0: verifying module: git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0: reading https://sum.golang.org/lookup/git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0: 410 Gone
server response: not found: git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0: unrecognized import path "git.sequentialread.com/forest/config-lite": https fetch: Get "https://git.sequentialread.com/forest/config-lite?go-get=1": dial tcp 71.34.16.185:443: connect: connection refused
delve-init:3: Process 101743 has exited with status 1
(dlv)
however if i change my breakpoint condition to conn.conn.fd.raddr.IP[3] == 123
then the breakpoint does hit before it crashes.
So where the hell is it getting 71.34.16.185
from ???
OMFG its happening because of a google service that is trying to connect to my git server . The error I am seeing is being thrown on the google telemetry server.
forest@thingpad:~$ curl https://sum.golang.org/lookup/git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0
not found: git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0: unrecognized import path "git.sequentialread.com/forest/config-lite": https fetch: Get "https://git.sequentialread.com/forest/config-lite?go-get=1": dial tcp 71.34.16.185:443: connect: connection refused
See the explanation at https://sum.golang.org
The google telemetry built into the go get
command is whats breaking it, its preventing it from functioning.
OK, to summarize:
go get
command / SaaS is designed to force go users to have their packages reachable on the public internet 100% of the time
server response
, is not nearly specific or notice-able enough to be understood by a human user encountering this error for the first time.I'm getting big
"Mac users couldn’t launch apps this afternoon after Apple verification server issue"
vibes right now, not gonna lie.
The work around is written here https://medium.com/mabar/today-i-learned-fix-go-get-private-repository-return-error-reading-sum-golang-org-lookup-93058a058dd8
export GONOSUMDB='*'
export GONOPROXY='*'
The error message should explain this workaround.
Also yall should probably not make tools that run on our work stations (like go get
) depend 100% on google servers by default. Its very disrespectful IMO.
See https://go.dev/ref/mod#private-module-proxy-direct The defaults are there so we can ensure software supply chain security across the ecosystem for most dependencies (which are public).
This is why I use the word "misleading", because pretty much every golang developer I run into (including myself before this issue thread) has no idea that this feature exists, and thier mental model of what go get
is doing is wrong.
So, in terms of my lived experience working with go for several years and seeing other people doing the same, I know that it is in fact misleading.
Whether it talks about this in some manual page somewhere or not doesn't really matter; no one is going to read that until after they discover that go get
isn't doing what they expected. The affordances and apparent behavior of the tool are the only way to "explain" this to users, I would argue that in that sense, the tool's behavior IS misleading.
I think the fix here is to modify checkSumDB
in cmd/go/internal/modfetch/fetch.go. If the call to lookupSumDB
fails, we should clarify that the error is being reported by the checksum database and point people at https://golang.org/ref/mod#authenticating and/or https://go.dev/ref/mod#checksum-database.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am trying to
go get
a module while I'm developing an app to fix my DNS issues, howevergo get
is ignoring the hosts file entry I created to temporarily fix my git server's incorrect domain name.does not work because my git server git.sequentialread.com is not reachable from the sum.golang.org google SaaS server which is tightly integrated into the way thego get
command works.What did you expect to see?
I expected the
go get
software do what I asked, go to my git server and download the module.However, in the event that
go get
cannot do that for me, I expected thego get
software to tell me in clear, human-readable terms why it cannot do that.What did you see instead?
When I 1st saw this error, I was 100% convinced that it was an issue related to golang not parsing
/etc/resolv.conf
,/etc/nsswitch.conf
or/etc/hosts
correctly. I quickly realized that it only happened withgo get
, not with a normal http call to git.sequentialread.com, so I decided to investigate further. However, after following that red herring all day long, I finally got to the point where I had run out of things to check and I could not make sense of what I was seeing, according to delvego get
WAS resolving the right IP address71.34.5.123
not the wrong one71.34.16.185
. It was connecting to71.34.5.123
, not71.34.16.185
. But I was still seeing an error that saysdial tcp 71.34.16.185:443: connect: connection refused
Eventually with dumb luck / trying anything after running out of options, I found the answer:
forest@thingpad:~$ curl https://sum.golang.org/lookup/git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0
not found: git.sequentialread.com/forest/config-lite@v0.0.0-20220122212408-4941a7aa3dc0: unrecognized import path "git.sequentialread.com/forest/config-lite": https fetch: Get "https://git.sequentialread.com/forest/config-lite?go-get=1": dial tcp 71.34.16.185:443: connect: connection refused
The error message I was seeing was actually being thrown on google's server, not on my computer.