x/tools/gopls: Error loading workspace due to missing go.sum entry (go1.18 & experimentalWorkspaceModule) #49668
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
As part of https://go-review.googlesource.com/c/tools/+/365454,
I am trying to add a new module dependency to x/tools/gopls module.
After I ran
go mod tidy
to add this new dependency,gopls
is nowstuck loading my workspace with this error.
What version of Go are you using (
go version
)?My gopls settings are:
Does this issue reproduce with the latest release?
Yes.
What did you expect to see?
Keep working.
Or the quick fix suggestsions ("Run go mod tidy", and "Update go.sum") resolve the issue.
What did you see instead?
Quick fixes succeeded according to the trace, but the problem persists.
I tried by disabling the multimodule workspace mode, but that doesn't help.
Strangely, when I tried to open golang.org/x/exp repo and ran
go mod tidy
with go1.18 to trim go.sum, I couldn't reproduce this issue.Gopls Log
``` [Trace - 21:40:27.274 PM] Sending notification 'initialized'. Params: {}[Trace - 21:40:27.274 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5577006791947779410"}
[Trace - 21:40:27.283 PM] Sending response 'window/workDoneProgress/create - (1)' in 9ms.
Result:
[Trace - 21:40:27.283 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}
[Trace - 21:40:27.283 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/projects/editor/tools","section":"gopls"}]}
[Trace - 21:40:27.293 PM] Sending response 'workspace/configuration - (2)' in 9ms.
Result: [{"verboseOutput":true,"build.experimentalWorkspaceModule":true}]
[Trace - 21:40:27.418 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/11/18 21:40:27 go env for /Users/hakim/projects/editor/tools\n(root /Users/hakim/projects/editor/tools)\n(go version go version devel go1.18-e8cda0a6c9 Fri Nov 19 00:05:59 2021 +0000 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGOPATH=/Users/hakim/go\nGOROOT=/Users/hakim/sdk/gotip\nGOSUMDB=sum.golang.org\nGOPROXY=https://proxy.golang.org,direct\nGONOPROXY=\nGOCACHE=/Users/hakim/Library/Caches/go-build\nGONOSUMDB=\nGOFLAGS=\nGOINSECURE=\nGOMOD=/Users/hakim/projects/editor/tools/go.mod\nGOMODCACHE=/Users/hakim/go/pkg/mod\nGOPRIVATE=\nGO111MODULE=\n\n"}
[Trace - 21:40:27.418 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/11/18 21:40:27 19.399979ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=off GOPROXY=https://proxy.golang.org,direct PWD=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/gopls-workspace-mod327506909 go list -e -f {{context.ReleaseTags}} -- unsafe\n"}
[Trace - 21:40:27.432 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/11/18 21:40:27 31.96415ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/gopls-workspace-mod327506909 go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.4fd452b258d29c5c9a2a77f67c3c547cba53a0ff88f57fb815a95c9f74b4fdb8.3713232661.mod -mod=readonly -f "{{context.GOARCH}} {{context.Compiler}}" -- unsafe\n"}
[Info - 9:40:27 PM] 2021/11/18 21:40:27 go env for /Users/hakim/projects/editor/tools
(root /Users/hakim/projects/editor/tools)
(go version go version devel go1.18-e8cda0a6c9 Fri Nov 19 00:05:59 2021 +0000 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GOPATH=/Users/hakim/go
GOROOT=/Users/hakim/sdk/gotip
GOSUMDB=sum.golang.org
GOPROXY=https://proxy.golang.org,direct
GONOPROXY=
GOCACHE=/Users/hakim/Library/Caches/go-build
GONOSUMDB=
GOFLAGS=
GOINSECURE=
GOMOD=/Users/hakim/projects/editor/tools/go.mod
GOMODCACHE=/Users/hakim/go/pkg/mod
GOPRIVATE=
GO111MODULE=
[Info - 9:40:27 PM] 2021/11/18 21:40:27 19.399979ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=off GOPROXY=https://proxy.golang.org,direct PWD=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/gopls-workspace-mod327506909 go list -e -f {{context.ReleaseTags}} -- unsafe
[Info - 9:40:27 PM] 2021/11/18 21:40:27 31.96415ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/gopls-workspace-mod327506909 go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.4fd452b258d29c5c9a2a77f67c3c547cba53a0ff88f57fb815a95c9f74b4fdb8.3713232661.mod -mod=readonly -f "{{context.GOARCH}} {{context.Compiler}}" -- unsafe
[Trace - 21:40:28.268 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/11/18 21:40:28 848.838521ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/gopls-workspace-mod327506909 go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.4fd452b258d29c5c9a2a77f67c3c547cba53a0ff88f57fb815a95c9f74b4fdb8.3713232661.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin golang.org/x/tools/... golang.org/x/tools/gopls/...\n"}
[Info - 9:40:28 PM] 2021/11/18 21:40:28 848.838521ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/gopls-workspace-mod327506909 go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.4fd452b258d29c5c9a2a77f67c3c547cba53a0ff88f57fb815a95c9f74b4fdb8.3713232661.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin golang.org/x/tools/... golang.org/x/tools/gopls/...
[Trace - 21:40:28.268 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/11/18 21:40:28 go/packages.Load: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\ngo: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\n\n\tsnapshot=0\n\tdirectory=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/gopls-workspace-mod327506909\n\tquery=[builtin golang.org/x/tools/... golang.org/x/tools/gopls/...]\n\tpackages=0\n"}
[Trace - 21:40:28.268 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/11/18 21:40:28 initial workspace load failed: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\ngo: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\n: packages.Load error\n"}
[Trace - 21:40:28.268 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"end","message":"Finished loading packages."}}
[Trace - 21:40:28.269 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/11/18 21:40:28 workspace packages: diagnosing file:///Users/hakim/projects/editor/tools/go.mod: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\ngo: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\n: packages.Load error\n"}
[Trace - 21:40:28.269 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/11/18 21:40:28 workspace packages: diagnosing file:///Users/hakim/projects/editor/tools/gopls/go.mod: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\ngo: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\n: packages.Load error\n"}
[Trace - 21:40:28.269 PM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/*.*tmpl","kind":7},{"globPattern":"/*.{go,mod,sum,work,tmpl}","kind":7},{"globPattern":"{/Users/hakim/projects/editor/tools/gopls}","kind":7}]}}]}
[Error - 9:40:28 PM] 2021/11/18 21:40:28 go/packages.Load: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
[Error - 9:40:28 PM] 2021/11/18 21:40:28 initial workspace load failed: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
: packages.Load error
[Error - 9:40:28 PM] 2021/11/18 21:40:28 workspace packages: diagnosing file:///Users/hakim/projects/editor/tools/go.mod: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
: packages.Load error
[Error - 9:40:28 PM] 2021/11/18 21:40:28 workspace packages: diagnosing file:///Users/hakim/projects/editor/tools/gopls/go.mod: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
: packages.Load error
[Trace - 21:40:28.271 PM] Sending response 'client/registerCapability - (3)' in 1ms.
Result:
[Trace - 21:40:28.271 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"}]}
[Trace - 21:40:28.272 PM] Sending response 'client/registerCapability - (4)' in 1ms.
Result:
[Trace - 21:40:28.396 PM] Received request 'window/workDoneProgress/create - (5)'.
Params: {"token":"8674665223082153551"}
[Trace - 21:40:28.396 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/11/18 21:40:28 errors loading workspace: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\ngo: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires\n\tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires\n\tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:\n\tgo mod download github.com/Microsoft/go-winio\n: packages.Load error\n\tsnapshot=0\n\tdirectory=file:///Users/hakim/projects/editor/tools\n"}
[Error - 9:40:28 PM] 2021/11/18 21:40:28 errors loading workspace: err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires
golang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires
github.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it:
go mod download github.com/Microsoft/go-winio
: packages.Load error
snapshot=0
directory=file:///Users/hakim/projects/editor/tools
[Trace - 21:40:28.397 PM] Sending response 'window/workDoneProgress/create - (5)' in 0ms.
Result:
[Trace - 21:40:28.397 PM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"begin","title":"Error loading workspace","message":"err: exit status 1: stderr: go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires \tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires \tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it: \tgo mod download github.com/Microsoft/go-winio go: golang.org/x/tools/gopls@v1.9999999.0-goplsworkspace requires \tgolang.org/x/vuln@v0.0.0-20211109030331-63d5d8171d01 requires \tgithub.com/Microsoft/go-winio@v0.4.16: missing go.sum entry; to add it: \tgo mod download github.com/Microsoft/go-winio : packages.Load error"}}
[Trace - 21:40:28.400 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/editor/tools/gopls/go.mod","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":31}},"severity":1,"source":"go list","message":"go.sum is out of sync with go.mod. Please update it by applying the quick fix."}]}
[Trace - 21:40:28.400 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/editor/tools/go.mod","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":25}},"severity":1,"source":"go list","message":"go.sum is out of sync with go.mod. Please update it by applying the quick fix."}]}
The text was updated successfully, but these errors were encountered: