Skip to content

cmd/go: install golang.org/x/tools/gopls@latest failed #65431

Not planned
@TasoHower

Description

@TasoHower

Go version

go version go1.21.6 darwin/amd64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/tasohower/Library/Caches/go-build'
GOENV='/Users/tasohower/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE='gitlab.aiforward.cn'
GOMODCACHE='/Users/tasohower/go/pkg/mod'
GONOPROXY='gitlab.aiforward.cn'
GONOSUMDB='gitlab.aiforward.cn'
GOOS='darwin'
GOPATH='/Users/tasohower/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/tasohower/go/src/web/go.mod'
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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/kt/xl9s7lx55jl_bggy6t_0gyrc0000gp/T/go-build2704161692=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I am try to get latest gopls.

What did you see happen?

Installing golang.org/x/tools/gopls@latest FAILED
{
 "code": 1,
 "killed": false,
 "signal": null,
 "cmd": "/usr/local/go/bin/go install -v golang.org/x/tools/gopls@latest",
 "stdout": "",
 "stderr": "golang.org/x/tools/gopls/internal/hooks\n# golang.org/x/tools/gopls/internal/hooks\n../../pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/hooks/hooks.go:28:28: undefined: xurls.Relaxed\n"
}

1 tools failed to install.

gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: /usr/local/go/bin/go install -v golang.org/x/tools/gopls@latest
golang.org/x/tools/gopls/internal/hooks
# golang.org/x/tools/gopls/internal/hooks
../../pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/hooks/hooks.go:28:28: undefined: xurls.Relaxed

What did you expect to see?

I download many times..

Activity

changed the title [-]import/path: issue title[/-] [+]Installing golang.org/x/tools/gopls@v0.14.2 FAILEDimport/path: issue title[/+] on Feb 1, 2024
added
goplsIssues related to the Go language server, gopls.
on Feb 1, 2024
changed the title [-]Installing golang.org/x/tools/gopls@v0.14.2 FAILEDimport/path: issue title[/-] [+]Installing golang.org/x/tools/gopls@v0.14.2 FAILED[/+] on Feb 1, 2024
TasoHower

TasoHower commented on Feb 1, 2024

@TasoHower
Author

And I got "undeclared name: any" when using vscode.

go version: go1.21.6 darwin/amd64

image image
changed the title [-]Installing golang.org/x/tools/gopls@v0.14.2 FAILED[/-] [+]cmd/go: install golang.org/x/tools/gopls@latest failed[/+] on Feb 1, 2024
adonovan

adonovan commented on Feb 1, 2024

@adonovan
Member

I think there are two problems here, and unfortunately I can't explain either of them yet. (I've retitled the issue for the first one.)

I tried this command to reproduce the problem, with no luck (it works fine):

GOPROXY="https://goproxy.cn,direct" GOMODCACHE=$(mktemp -d) GOCACHE=$(mktemp -d) go install golang.org/x/tools/gopls@latest

I don't understand why you would see a missing symbol error (xurls.Relaxed) but not a missing package or module error first. (Perhaps the alternative proxy delivered the wrong version of the right package? But it seems fine at the moment.)

@bcmills @matloob

adonovan

adonovan commented on Feb 1, 2024

@adonovan
Member

@findleyr points out that the second error ('any') is likely a consequence of running an old version of gopls that doesn't include the post-generics type checker. Once we fix the real problem of installation it should go away.

TasoHower

TasoHower commented on Feb 2, 2024

@TasoHower
Author

I think there are two problems here, and unfortunately I can't explain either of them yet. (I've retitled the issue for the first one.)

I tried this command to reproduce the problem, with no luck (it works fine):

GOPROXY="https://goproxy.cn,direct" GOMODCACHE=$(mktemp -d) GOCACHE=$(mktemp -d) go install golang.org/x/tools/gopls@latest

I don't understand why you would see a missing symbol error (xurls.Relaxed) but not a missing package or module error first. (Perhaps the alternative proxy delivered the wrong version of the right package? But it seems fine at the moment.)

@bcmills @matloob

I reinstall my gosdk with vscode. Secound problom has fixed.(Install go verison 1.20.3 and reinstall 1.21.6 at once)
image

adonovan

adonovan commented on Feb 2, 2024

@adonovan
Member

I reinstall my gosdk with vscode. Second problem has fixed.

Glad to hear it. Does that mean you are still able to reproduce the first problem? If so, we would love to get to the bottom of this, as we wonder whether a large number of users in China are experiencing similar problems with the proxy.

Could you run this command and tell us what happens?

GOPROXY="https://goproxy.cn" GOMODCACHE=$(mktemp -d) GOCACHE=$(mktemp -d) go install golang.org/x/tools/gopls@latest

Thanks.

TasoHower

TasoHower commented on Feb 2, 2024

@TasoHower
Author

I reinstall my gosdk with vscode. Second problem has fixed.

Glad to hear it. Does that mean you are still able to reproduce the first problem? If so, we would love to get to the bottom of this, as we wonder whether a large number of users in China are experiencing similar problems with the proxy.

Could you run this command and tell us what happens?

GOPROXY="https://goproxy.cn" GOMODCACHE=$(mktemp -d) GOCACHE=$(mktemp -d) go install golang.org/x/tools/gopls@latest

Thanks.

WOW ,THANKS! So, this problem is cause of my VPN server ?

go: downloading golang.org/x/tools/gopls v0.14.2
go: downloading golang.org/x/tools v0.17.0
go: downloading golang.org/x/tools v0.14.1-0.20231114185516-c9d3e7de13fd
go: downloading golang.org/x/telemetry v0.0.0-20231114163143-69313e640400
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading honnef.co/go/tools v0.4.5
go: downloading mvdan.cc/gofumpt v0.4.0
go: downloading mvdan.cc/xurls/v2 v2.4.0
go: downloading golang.org/x/mod v0.14.0
go: downloading golang.org/x/sync v0.4.0
go: downloading golang.org/x/text v0.13.0
go: downloading golang.org/x/sys v0.14.0
go: downloading golang.org/x/vuln v1.0.1
go: downloading github.com/google/go-cmp v0.5.9
go: downloading golang.org/x/exp/typeparams v0.0.0-20221212164502-fae10dda9338
go: downloading github.com/BurntSushi/toml v1.2.1

adonovan

adonovan commented on Feb 2, 2024

@adonovan
Member

So, this problem is cause of my VPN server ?

We still don't have a hypothesis. The command above should reproduce the command that was failing in your initial report, but it seems from all the "downloading" messages that it completed successfully.

findleyr

findleyr commented on Feb 2, 2024

@findleyr
Member

Do you have any additional settings in your VS Code environment? Can you share your exact VS Code and VS Code Go extension versions?

  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
  • Check your installed extensions to get the version of the VS Code Go extension
added
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Mar 22, 2024
gopherbot

gopherbot commented on Apr 22, 2024

@gopherbot
Contributor

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

locked and limited conversation to collaborators on Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @adonovan@gopherbot@seankhliao@findleyr@TasoHower

        Issue actions

          cmd/go: install golang.org/x/tools/gopls@latest failed · Issue #65431 · golang/go