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

go install fails when GOPROXY is empty #62274

Closed
juchem opened this issue Aug 24, 2023 · 4 comments
Closed

go install fails when GOPROXY is empty #62274

juchem opened this issue Aug 24, 2023 · 4 comments

Comments

@juchem
Copy link

juchem commented Aug 24, 2023

What version of Go are you using (go version)?

go version go1.21.0 linux/amd64

Does this issue reproduce with the latest release?

yes

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

GO111MODULE=''
GOARCH='amd64'
GOBIN='/usr/local/bin'
GOCACHE='/var/cache/go/cache'
GOENV='/var/cache/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/var/cache/go/mod-cache'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/var/cache/go/path'
GOPRIVATE=''
GOPROXY=''
GOROOT='/usr/local/go'
GOSUMDB=''
GOTMPDIR=''
GOTOOLCHAIN=''
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build319333080=/tmp/go-build -gno-record-gcc-switches'

What did you do?

attempting to install a tool with go install when no GOPROXY is set fails:

$ go install -v -x golang.org/x/lint/golint@latest
go: golang.org/x/lint/golint@latest: GOPROXY list is not the empty string, but contains no entries

Manually setting a proxy to something other than the empty string succeeds:

$ GOPROXY=proxy.golang.org go install -v -x golang.org/x/lint/golint@latest
# get https://proxy.golang.org/golang.org/@v/list
# get https://proxy.golang.org/golang.org/x/lint/@v/list
# get https://proxy.golang.org/golang.org/x/lint/golint/@v/list
# get https://proxy.golang.org/golang.org/x/@v/list
# get https://proxy.golang.org/golang.org/@v/list: 404 Not Found (0.087s)
# get https://proxy.golang.org/golang.org/x/@v/list: 404 Not Found (0.086s)
# get https://proxy.golang.org/golang.org/x/lint/@v/list: 200 OK (0.098s)
# get https://proxy.golang.org/golang.org/x/lint/@latest
# get https://proxy.golang.org/golang.org/x/lint/@latest: 200 OK (0.037s)
# get https://proxy.golang.org/golang.org/x/lint/@v/v0.0.0-20210508222113-6edffad5e616.mod
# get https://proxy.golang.org/golang.org/x/lint/golint/@v/list: 404 Not Found (0.136s)
# get https://proxy.golang.org/golang.org/x/lint/@v/v0.0.0-20210508222113-6edffad5e616.mod: 200 OK (0.015s)
go: downloading golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
# get https://proxy.golang.org/golang.org/x/lint/@v/v0.0.0-20210508222113-6edffad5e616.zip
# get https://proxy.golang.org/golang.org/x/lint/@v/v0.0.0-20210508222113-6edffad5e616.zip: 200 OK (0.014s)
go: golang.org/x/lint/golint@latest: golang.org/x/[email protected]: verifying module: missing GOSUMDB
$ GOPROXY=direct go install -v -x golang.org/x/lint/golint@latest
# get https://golang.org/?go-get=1
# get https://golang.org/x/lint/golint?go-get=1
# get https://golang.org/x/lint?go-get=1
# get https://golang.org/x?go-get=1
# get https://golang.org/x/lint/golint?go-get=1: 200 OK (0.092s)
get "golang.org/x/lint/golint": found meta tag vcs.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at //golang.org/x/lint/golint?go-get=1
get "golang.org/x/lint/golint": verifying non-authoritative meta tag
# get https://golang.org/x/lint?go-get=1
# get https://golang.org/x/lint?go-get=1: 200 OK (0.093s)
get "golang.org/x/lint": found meta tag vcs.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at //golang.org/x/lint?go-get=1
mkdir -p /var/cache/go/mod-cache/cache/vcs # git3 https://go.googlesource.com/lint
# lock /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307.lock
# /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307 for git3 https://go.googlesource.com/lint
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git ls-remote -q origin
# get https://golang.org/x/lint?go-get=1: 200 OK (0.041s)
# get https://golang.org/?go-get=1: 200 OK (0.202s)
# get https://golang.org/x?go-get=1: 200 OK (0.276s)
0.185s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git ls-remote -q origin
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 6edffad5e6160f5949cdefc81710b2706fbcd4f6 --
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 6edffad5e6160f5949cdefc81710b2706fbcd4f6 --
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git for-each-ref --format %(refname) refs/tags --merged 6edffad5e6160f5949cdefc81710b2706fbcd4f6
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git for-each-ref --format %(refname) refs/tags --merged 6edffad5e6160f5949cdefc81710b2706fbcd4f6
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git for-each-ref --format %(refname) refs/tags --merged 6edffad5e6160f5949cdefc81710b2706fbcd4f6
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git for-each-ref --format %(refname) refs/tags --merged 6edffad5e6160f5949cdefc81710b2706fbcd4f6
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 6edffad5e616 --
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 6edffad5e616 --
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:golint/go.mod
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:golint/go.mod
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
go: downloading golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
0.001s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git cat-file blob 6edffad5e6160f5949cdefc81710b2706fbcd4f6:go.mod
cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ 6edffad5e6160f5949cdefc81710b2706fbcd4f6
0.006s # cd /var/cache/go/mod-cache/cache/vcs/716d0082b8f26fcf2fc1ee11162cffec6127a782d0c9b4b7d94607517e903307; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ 6edffad5e6160f5949cdefc81710b2706fbcd4f6
go: golang.org/x/lint/golint@latest: golang.org/x/[email protected]: verifying module: missing GOSUMDB

What did you expect to see?

This behavior differs drastically from previous versions of go and breaks all our CI and dev environments.

I didn't find any mentions of this new behavior in the release notes: https://tip.golang.org/doc/go1.21

What did you see instead?

error message: GOPROXY list is not the empty string, but contains no entries

@seankhliao
Copy link
Member

How did you install go and what's in $GOROOT/go.env?

@juchem
Copy link
Author

juchem commented Aug 24, 2023

go was built from sources following these instructions: https://go.dev/doc/install/source

The file $GOROOT/go.env does not exist:

$ cat $(go env GOROOT)/go.env
cat: /usr/local/go/go.env: No such file or directory

I've added the output of go env to the issue description.

I found one mention of the same issue from a SUSE Linux mailing list: https://lists.suse.com/pipermail/sle-updates/2023-August/031016.html

@seankhliao
Copy link
Member

Our sources have go.env in the root, that's where the defaults are now set.
You should look into why yours don't.

@juchem
Copy link
Author

juchem commented Aug 24, 2023

@seankhliao I just rebuilt golang 1.21 after your previous message and noticed that go.env is indeed generated, but we're not copying it to $GOROOT.

Is there a list of which files are required to be copied over from the build directory?

I'll go ahead and close this issue since it's on our end.

@juchem juchem closed this as completed Aug 24, 2023
qinqon added a commit to qinqon/nmstate that referenced this issue Nov 7, 2023
Latest go 1.21 installed at dev c9s image need a pair of go env to be
set. This change configure them with default values.

golang/go#62274
golang/go#31964

Signed-off-by: Enrique Llorente <[email protected]>
cathay4t pushed a commit to nmstate/nmstate that referenced this issue Nov 7, 2023
Latest go 1.21 installed at dev c9s image need a pair of go env to be
set. This change configure them with default values.

golang/go#62274
golang/go#31964

Signed-off-by: Enrique Llorente <[email protected]>
@golang golang locked and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants