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

x/tools/gopls: updates to go.sum needed, disabled by -mod=readonly with experimentalWorkspaceModule #44097

Closed
samstride opened this issue Feb 4, 2021 · 12 comments
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@samstride
Copy link

samstride commented Feb 4, 2021

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

$ go version go1.15.7 darwin/amd64

VSCode Go extension v0.22.0

Does this issue reproduce with the latest release?

Issue introduced by updating gopls to v0.6.5

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

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/darkknight/Library/Caches/go-build"
GOENV="/Users/darkknight/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/darkknight/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/darkknight/go:/Users/darkknight/customer1:/Users/darkknight/customer2:/Users/darkknight/customer3:/Users/darkknight/customer4"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/tl/tyrrj6b51p38llg9h907lls80000gn/T/go-build312388104=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Updated gopls to v0.6.5

VSCode settings for gopls:

 "gopls": {
        "build.experimentalWorkspaceModule": true,
        "build.expandWorkspaceToModule": true
    }

What did you expect to see?

No gopls errors.

What did you see instead?

Below output from gopls (server)

[Info  - 4:13:37 PM] 2021/02/04 16:13:37 go env for /Users/darkknight/customer1
(root /Users/darkknight/customer1)
(go version go version go1.15.7 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GO111MODULE=
GOCACHE=/Users/darkknight/Library/Caches/go-build
GOMOD=
GONOPROXY=
GOPATH=/Users/darkknight/go:/Users/darkknight/customer1:/Users/darkknight/customer2:/Users/darkknight/customer3:/Users/darkknight/customer4
GOROOT=/usr/local/go
GOSUMDB=sum.golang.org
GOFLAGS=
GOPROXY=https://proxy.golang.org,direct
GOINSECURE=
GOMODCACHE=/Users/darkknight/go/pkg/mod
GONOSUMDB=
GOPRIVATE=


[Error - 4:13:39 PM] 2021/02/04 16:13:39 go/packages.Load: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly

	snapshot=0
	directory=/var/folders/tl/tyrrj6b51p38llg9h907lls80000gn/T/gopls-workspace-mod820359162
	query=[<REDACTED list_of_multiple_folders/...>]
	packages=0


[Error - 4:13:39 PM] 2021/02/04 16:13:39 initial workspace load failed: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly
: packages.Load error

[Error - 4:13:39 PM] 2021/02/04 16:13:39 errors loading workspace: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly
: packages.Load error
	snapshot=0
	directory=file:///Users/darkknight/customer1

[Error - 4:13:41 PM] 2021/02/04 16:13:41 go/packages.Load: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly


Attempted to fix errors by running go mod tidy but that did not help.

Screen Shot 2021-02-04 at 12 58 55 PM

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 4, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 4, 2021
@stamblerre
Copy link
Contributor

Thanks for opening this issue. Are you able to share the full log? Redacting pieces is fine, but a complete log will help us get a better sense of the issue.

@heschik: My guess is that this is caused by https://golang.org/cl/287032 because @samstride is using the experimental workspace module (#44085 (comment)).

@stamblerre stamblerre changed the title x/tools/gopls: v0.6.5 errors loading workspace: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly x/tools/gopls: updates to go.sum needed, disabled by -mod=readonly with experimentalWorkspaceModule Feb 4, 2021
@samstride
Copy link
Author

@stamblerre , edited original post and added the missing go env part of the logs.

Sorry, did I need to do something else (like turn rpc traces on) and paste those logs?

@stamblerre
Copy link
Contributor

Yes, if you could share the logs with the following setting enabled that would be best.

"go.languageServerFlags": [
  "-rpc.trace"
]

@samstride
Copy link
Author

[Trace - 17:45:58.091 PM] Sending request 'initialize - (0)'.
Params: {"processId":15312,"clientInfo":{"name":"vscode","version":"1.52.1"},"rootPath":"/Users/darkknight/customer1","rootUri":"file:///Users/darkknight/customer1","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","member","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}}}},"window":{"workDoneProgress":true}},"initializationOptions":{"build.experimentalWorkspaceModule":true,"build.expandWorkspaceToModule":true},"trace":"off","workspaceFolders":[{"uri":"file:///Users/darkknight/customer1","name":"customer1"}]}


[Trace - 17:45:58.093 PM] Received response 'initialize - (0)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.generate","gopls.fill_struct","gopls.regenerate_cgo","gopls.test","gopls.tidy","gopls.update_go_sum","gopls.undeclared_name","gopls.go_get_package","gopls.check_upgrades","gopls.add_dependency","gopls.upgrade_dependency","gopls.remove_dependency","gopls.vendor","gopls.extract_variable","gopls.extract_function","gopls.gc_details","gopls.generate_gopls_mod"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{\"path\":\"golang.org/x/tools/gopls\",\"version\":\"v0.6.5\",\"sum\":\"h1:kLt9rD/dWtVdvc8LmdcxagDFih6zxYXREpKSYYZu5KE=\",\"deps\":[{\"path\":\"github.com/BurntSushi/toml\",\"version\":\"v0.3.1\",\"sum\":\"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\"},{\"path\":\"github.com/google/go-cmp\",\"version\":\"v0.5.4\",\"sum\":\"h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=\"},{\"path\":\"github.com/sergi/go-diff\",\"version\":\"v1.1.0\",\"sum\":\"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\"},{\"path\":\"golang.org/x/mod\",\"version\":\"v0.4.0\",\"sum\":\"h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=\"},{\"path\":\"golang.org/x/sync\",\"version\":\"v0.0.0-20201020160332-67f06af15bc9\",\"sum\":\"h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=\"},{\"path\":\"golang.org/x/sys\",\"version\":\"v0.0.0-20210119212857-b64e53b001e4\",\"sum\":\"h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=\"},{\"path\":\"golang.org/x/tools\",\"version\":\"v0.1.1-0.20210201201750-4d4ee958a9b7\",\"sum\":\"h1:/wdPW261t381NDQd8TBo63/FyvACfLICwtH8wMRoHJQ=\"},{\"path\":\"golang.org/x/xerrors\",\"version\":\"v0.0.0-20200804184101-5ec99f83aff1\",\"sum\":\"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\"},{\"path\":\"honnef.co/go/tools\",\"version\":\"v0.0.1-2020.1.6\",\"sum\":\"h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=\"},{\"path\":\"mvdan.cc/gofumpt\",\"version\":\"v0.1.0\",\"sum\":\"h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=\"},{\"path\":\"mvdan.cc/xurls/v2\",\"version\":\"v2.2.0\",\"sum\":\"h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\"}]}"}}


[Trace - 17:45:58.153 PM] Sending notification 'initialized'.
Params: {}


[Trace - 17:45:58.153 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5577006791947779410"}


[Trace - 17:45:58.154 PM] Sending response 'window/workDoneProgress/create - (1)' in 0ms.
Result: 


[Trace - 17:45:58.154 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}


[Trace - 17:45:58.154 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///Users/darkknight/customer1","section":"gopls"}]}


[Trace - 17:45:58.158 PM] Sending response 'workspace/configuration - (2)' in 3ms.
Result: [{"build.experimentalWorkspaceModule":true,"build.expandWorkspaceToModule":true}]


[Trace - 17:45:58.270 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/04 17:45:58 go env for /Users/darkknight/customer1\n(root /Users/darkknight/customer1)\n(go version go version go1.15.7 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGO111MODULE=\nGOCACHE=/Users/darkknight/Library/Caches/go-build\nGONOPROXY=\nGOPRIVATE=\nGOFLAGS=\nGOINSECURE=\nGOROOT=/usr/local/go\nGOSUMDB=sum.golang.org\nGONOSUMDB=\nGOMOD=\nGOMODCACHE=/Users/darkknight/go/pkg/mod\nGOPATH=/Users/darkknight/go:/Users/darkknight/customer1:/Users/darkknight/customer2:/Users/darkknight/customer3:/Users/darkknight/customer4\nGOPROXY=https://proxy.golang.org,direct\n\n"}


[Info  - 5:45:58 PM] 2021/02/04 17:45:58 go env for /Users/darkknight/customer1
(root /Users/darkknight/customer1)
(go version go version go1.15.7 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GO111MODULE=
GOCACHE=/Users/darkknight/Library/Caches/go-build
GONOPROXY=
GOPRIVATE=
GOFLAGS=
GOINSECURE=
GOROOT=/usr/local/go
GOSUMDB=sum.golang.org
GONOSUMDB=
GOMOD=
GOMODCACHE=/Users/darkknight/go/pkg/mod
GOPATH=/Users/darkknight/go:/Users/darkknight/customer1:/Users/darkknight/customer2:/Users/darkknight/customer3:/Users/darkknight/customer4
GOPROXY=https://proxy.golang.org,direct


[Trace - 17:45:59.750 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/04 17:45:59 go/packages.Load: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly\n\n\tsnapshot=0\n\tdirectory=/var/folders/tl/tyrrj6b51p38llg9h907lls80000gn/T/gopls-workspace-mod641793857\n\tquery=[support/api/... utils/... vault/...]\n\tpackages=0\n"}


[Trace - 17:45:59.750 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/04 17:45:59 initial workspace load failed: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly\n: packages.Load error\n"}


[Trace - 17:45:59.750 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"end","message":"Finished loading packages."}}


[Error - 5:45:59 PM] 2021/02/04 17:45:59 go/packages.Load: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly

	snapshot=0
	directory=/var/folders/tl/tyrrj6b51p38llg9h907lls80000gn/T/gopls-workspace-mod641793857
	query=[support/api/... utils/... vault/...]
	packages=0

[Error - 5:45:59 PM] 2021/02/04 17:45:59 initial workspace load failed: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly
: packages.Load error

[Trace - 17:45:59.751 PM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"{/Users/darkknight/customer1/support/api,/Users/darkknight/customer1/utils,/Users/darkknight/customer1/vault}","kind":7}]}}]}


[Trace - 17:45:59.763 PM] Sending response 'client/registerCapability - (3)' in 12ms.
Result: 


[Trace - 17:45:59.764 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"}]}


[Trace - 17:45:59.768 PM] Sending response 'client/registerCapability - (4)' in 4ms.
Result: 


[Trace - 17:45:59.925 PM] Received request 'window/workDoneProgress/create - (5)'.
Params: {"token":"8674665223082153551"}


[Trace - 17:45:59.925 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/04 17:45:59 errors loading workspace: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly\n: packages.Load error\n\tsnapshot=0\n\tdirectory=file:///Users/darkknight/customer1\n"}


[Error - 5:45:59 PM] 2021/02/04 17:45:59 errors loading workspace: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly
: packages.Load error
	snapshot=0
	directory=file:///Users/darkknight/customer1

[Trace - 17:45:59.927 PM] Sending response 'window/workDoneProgress/create - (5)' in 2ms.
Result: 


[Trace - 17:45:59.927 PM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"begin","title":"Error loading workspace","message":"err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly : packages.Load error"}}

[Trace - 17:45:59.930 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/darkknight/customer1/utils/go.mod","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":12}},"severity":1,"message":"err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly\n: packages.Load error"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":12}},"severity":1,"message":"go.sum is out of sync with go.mod. Please update it or run \"go mod tidy\"."}]}

[Trace - 17:45:59.931 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/darkknight/customer1/vault/go.mod","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":12}},"severity":1,"message":"err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly\n: packages.Load error"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":12}},"severity":1,"message":"go.sum is out of sync with go.mod. Please update it or run \"go mod tidy\"."}]}

[Trace - 17:45:59.937 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/darkknight/customer1/support/api/go.mod","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":18}},"severity":1,"message":"err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly\n: packages.Load error"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":18}},"severity":1,"message":"go.sum is out of sync with go.mod. Please update it or run \"go mod tidy\"."}]}

@stamblerre
Copy link
Contributor

Thank you for sharing these logs. Can you please run gopls workspace generate from the root of your multi-module workspace and share the contents of the generated gopls.mod file here?

Then, can you please try running go mod tidy in each of the modules in your workspace? (support/api/, utils/, and vault/) Once you do so, can you restart the editor and confirm if that fixes the problem?

Obviously this error message is not useful at all, so that's an issue, but I just want to confirm that I understand the problem first.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 4, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.6.6 Feb 4, 2021
@findleyr
Copy link
Contributor

findleyr commented Feb 4, 2021

I'll echo what @stamblerre said: thank you for taking the time to report this, it's really helpful for us to get error reports from users experimenting with workspace modules as we work on this feature.

One additional note: be aware that the gopls.mod file you create with gopls workspace generate will override the automatic workspace discovery, so you'll probably want to delete it when you're done.

@samstride
Copy link
Author

Hmmm, ok, so the original rpc logs I pasted had folders names modified/redacted.

So when I use gopls workspace generate and modify the gopls.mod file to match the logs I provided, it works.

As mentioned, the error message is not very helpful for now and I need to figure out where the error is in my workspace. I have 50+ mod files in the my workspace.

Anyways, here is the output (any idea why I have go 1.12 below?):

module gopls-workspace

go 1.12

require (
	config v1.9999999.0-goplsworkspace
	filestore/api v1.9999999.0-goplsworkspace
	support/api v1.9999999.0-goplsworkspace
	support/lookup v1.9999999.0-goplsworkspace
	utils v1.9999999.0-goplsworkspace
	vault v1.9999999.0-goplsworkspace
)

replace utils => /Users/darkknight/customer1/utils

replace config => /Users/darkknight/customer1/config

replace vault => /Users/darkknight/customer1/vault

replace filestore/api => /Users/darkknight/customer1/filestore/api

replace support/api => /Users/darkknight/customer1/support/api

replace support/lookup => /Users/darkknight/customer1/support/lookup

The above works since I modified it to match the logs provided.

@samstride
Copy link
Author

Woohoooo... I found 2 modules that had issues: 1 module had go code that wasn't correct and the other one had a bad package. Once I sorted that out, the whole thing fixed itself.

Until the error message can be fixed, I guess the only way to find the root cause it is to open up each module and look for errors.

@findleyr
Copy link
Contributor

findleyr commented Feb 4, 2021

Thanks @samstride. The go 1.12 directive is just our default: it doesn't currently matter.

The above works since I modified it to match the logs provided.

Do you mean that by limiting your gopls.mod to just these modules, your workspace loaded without error?

Woohoooo... I found 2 modules that had issues: 1 module had go code that wasn't correct and the other one had a bad package. Once I sorted that out, the whole thing fixed itself.

Well, I'm glad you figured it out but we agree, the whole UX of this failure mode needs to be improved. Thanks for reporting, and for following up.

@stamblerre
Copy link
Contributor

Woohoooo... I found 2 modules that had issues: 1 module had go code that wasn't correct and the other one had a bad package. Once I sorted that out, the whole thing fixed itself.

Also, do you mind clarifying what steps you took to correct the broken modules? Did you run go mod tidy?

@samstride
Copy link
Author

samstride commented Feb 5, 2021

@stamblerre, How to reproduce the issue I was facing:

  • Say you had multiple folders customer1/project1 with module project1, customer1/project2 with module project2 and so on. I had this folder called customer1/fider which was a clone of github.com/getfider/fider but the mod file was module github.com/getfider/fider. I simply removed this folder and the issue fixed itself.

I did run go mod tidy earlier in the day before I found the issue and removed the folder.

@findleyr , yup, by limiting the gopls.mod file to specific folders, the issue disappears.

BTW, I am happy to jump on a meet call and share my screen if that helps.

@gopherbot
Copy link

Change https://golang.org/cl/289772 mentions this issue: internal/lsp: apply go.sum fixes to all modules in multi-module module

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants