Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: test failure for TestScript/mod_sumdb_proxy: lookup localhost.localdev: No address associated with hostname #31779

Closed
shakeel opened this issue May 1, 2019 · 8 comments

Comments

Projects
None yet
6 participants
@shakeel
Copy link

commented May 1, 2019

Does this issue reproduce with the latest release?

Yes, only when trying to rebuild go from source code

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/shakeel/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/shakeel/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/shakeel/devel/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build752315561=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Local environment with network proxy (http and https proxy and ignore hosts setup)

env | grep proxy
https_proxy=http://access401.cws.sco.cisco.com:8080/
http_proxy=http://access401.cws.sco.cisco.com:8080/
no_proxy=localhost,127.0.0.0/8,127.0.0.1,::1

Follow steps to build go from source code, then do the following

git pull
cd src
./all.bash

The following error is reported

ok  	cmd/fix	6.690s
go test proxy running at GOPROXY=http://127.0.0.1:35257/mod
go proxy: no archive rsc.io/x v0.1.0: file does not exist
--- FAIL: TestScript (0.00s)
    --- FAIL: TestScript/mod_sumdb_proxy (1.45s)
        script_test.go:192: 
            # basic fetch (through proxy) works (0.370s)
            # can fetch by explicit URL (0.100s)
            # direct access fails (because localhost.localdev does not exist) (0.913s)
            > cp go.mod.orig go.mod
            > env GOSUMDB=$sumdb
            > env GOPROXY=direct
            > ! go get -m rsc.io/fortune@v1.0.0
            [stderr]
            verifying rsc.io/fortune@v1.0.0/go.mod: rsc.io/fortune@v1.0.0/go.mod: initializing sumweb.Conn: checking tree#82: Get https://localhost.localdev/sumdb/tile/8/0/000.p/82: dial tcp: lookup localhost.localdev: No address associated with hostname
            [exit status 1]
            > stderr 'verifying.*localhost.localdev.*no such host'
            FAIL: testdata/script/mod_sumdb_proxy.txt:24: no match for `(?m)verifying.*localhost.localdev.*no such host` found in stderr
            
FAIL
FAIL	cmd/go	40.158s
ok  	cmd/go/internal/auth	0.082s

What did you expect to see?

go successfully built

What did you see instead?

2019/05/01 09:30:27 Failed: exit status 1

@ianlancetaylor ianlancetaylor changed the title all.bash fails on script_test.go:192 cmd/go: test failure for TestScript/mod_sumdb_proxy: lookup localhost.localdev: No address associated with hostname May 1, 2019

@ianlancetaylor ianlancetaylor added this to the Go1.13 milestone May 1, 2019

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented May 1, 2019

@gopherbot

This comment has been minimized.

Copy link

commented May 2, 2019

Change https://golang.org/cl/174838 mentions this issue: cmd/go: fix sumdb test falure

@jcajka

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

For the record I have seen similar issue on network disconnected hosts running all.bash.

go test proxy running at GOPROXY=http://127.0.0.1:44141/mod
go proxy: no archive rsc.io/x v0.1.0: file does not exist
--- FAIL: TestScript (0.00s)
    --- FAIL: TestScript/mod_sumdb_proxy (0.33s)
        script_test.go:192: 
            # basic fetch (through proxy) works (0.143s)
            # can fetch by explicit URL (0.160s)
            # direct access fails (because localhost.localdev does not exist) (0.025s)
            > cp go.mod.orig go.mod
            > env GOSUMDB=$sumdb
            > env GOPROXY=direct
            > ! go get -m rsc.io/fortune@v1.0.0
            [stderr]
            verifying rsc.io/fortune@v1.0.0/go.mod: rsc.io/fortune@v1.0.0/go.mod: initializing sumweb.Conn: checking tree#85: Get https://localhost.localdev/sumdb/tile/8/0/000.p/85: dial tcp: lookup localhost.localdev on [::1]:53: read udp [::1]:36423->[::1]:53: read: connection refused
            [exit status 1]
            > stderr 'verifying.*localhost.localdev.*no such host'
            FAIL: testdata/script/mod_sumdb_proxy.txt:24: no match for `(?m)verifying.*localhost.localdev.*no such host` found in stderr            
FAIL
FAIL	cmd/go	111.630s

@gopherbot gopherbot closed this in 7feb313 May 7, 2019

@danicat

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

I'm facing a similar error to this:

go test proxy running at GOPROXY=http://127.0.0.1:56675/mod
--- FAIL: TestScript (0.00s)
    --- FAIL: TestScript/mod_sumdb_proxy (3.21s)
        script_test.go:192: 
            # basic fetch (through proxy) works (0.579s)
            # can fetch by explicit URL (0.266s)
            # direct access fails (because localhost.localdev does not exist) (2.316s)
            > cp go.mod.orig go.mod
            > env GOSUMDB=$sumdb
            > env GOPROXY=direct
            > ! go get -m rsc.io/fortune@v1.0.0
            [stderr]
            verifying rsc.io/fortune@v1.0.0/go.mod: rsc.io/fortune@v1.0.0/go.mod: initializing sumweb.Conn: checking tree#95: Get https://localhost.localdev/sumdb/tile/8/0/000.p/95: dial tcp 92.242.132.24:443: connect: connection refused
            [exit status 1]
            > stderr 'verifying.*lookup.*localhost.localdev'
            FAIL: testdata/script/mod_sumdb_proxy.txt:24: no match for `(?m)verifying.*lookup.*localhost.localdev` found in stderr
            
FAIL
FAIL	cmd/go	127.737s

go env:

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/danielapetruzalek/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/danielapetruzalek/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/danielapetruzalek/golang/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jr/m8v074_17n1b6f8s_j6ds4b40000gn/T/go-build541496021=/tmp/go-build -gno-record-gcc-switches -fno-common"

This was on my MacBook, but I've tried the same code on my Pixelbook (linux VM) and got similar error.

@danicat

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

@ianlancetaylor it seems that this test is based on parsing an error message, which usually is not a good idea as the messages are not usually that stable. Can't we test this some other way?

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

@jayconrod jayconrod self-assigned this Jun 18, 2019

@jayconrod

This comment has been minimized.

Copy link
Contributor

commented Jun 18, 2019

Reproduced by mapping localhost.localdev to a bogus IP address in /etc/hosts. I saw this too because my home ISP resolves unknown hostnames to some ad server.

@gopherbot

This comment has been minimized.

Copy link

commented Jun 18, 2019

Change https://golang.org/cl/182799 mentions this issue: cmd/go: fix sumdb test failure with misbehaving DNS server

@gopherbot gopherbot closed this in 2ba9f7c Jun 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.