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: server stucks with a lot of meaningless messages of errors #32857

Closed
inliquid opened this issue Jun 29, 2019 · 20 comments
Closed
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

@inliquid
Copy link

VS Code.
Actually this happens all the time, if you work more than 30 min with some editing. It just stops working normally forcing to restart VS Code. And in fact there are no errors in files. See screenshot and logs for more information.
изображение

[Error - 23:30:16] unable to check package for file:///c:/***/***/***/git:/c:/***/***/***/pkg/config/defaults.go%3F%7B%22path%22:%22c:/***/***/***/pkg/config/defaults.go%22,%22ref%22:%22~%22%7D: go/packages.Load: no packages found for c:\***\***\***\git:\c:\***\***\***\pkg\config\defaults.go?{"path":"c:\***\***\***\pkg\config\defaults.go","ref":"~"}
[Error - 23:30:53] unable to check package for file:///c:/***/***/***/git:/c:/***/***/***/init.go%3F%7B%22path%22:%22c:/***/***/***/init.go%22,%22ref%22:%22~%22%7D: go/packages.Load: no packages found for c:\***\***\***\git:\c:\***\***\***\init.go?{"path":"c:\***\***\***\init.go","ref":"~"}
@gopherbot gopherbot added this to the Unreleased milestone Jun 29, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 29, 2019
@stamblerre
Copy link
Contributor

@inliquid: Can you confirm that this happens with the latest version of gopls? You can update by running go get -u golang.org/x/tools/gopls@master.

@inliquid
Copy link
Author

inliquid commented Jul 1, 2019

I'm updating gopls from master regularly. Gonna update now and see if this happens again. It also may be somehow related to vscode-go extension itself, because recently I seen quite similar messages from linter output.

@inliquid
Copy link
Author

inliquid commented Jul 1, 2019

@stamblerre I think -u is not needed when you are querying @master with modules. As I understand -u in this command will force to update dependencies of gopls module.

@stamblerre
Copy link
Contributor

Hm, well LSP is marked as the source of the diagnostic, so I expect it is probably gopls in this case. Please let me know if you still see this issue on master.

And yes, -u updates the dependencies, but I typically recommend it when updating to master because some of the fixes are in go/packages, which is in the x/tools repo, and as a result, a dependency of gopls.

@inliquid
Copy link
Author

inliquid commented Jul 1, 2019

Yep, still getting these errors;
изображение

@stamblerre
Copy link
Contributor

Are you able to share the full gopls for this case?

@inliquid
Copy link
Author

inliquid commented Jul 2, 2019

Sorry, what do you mean?

@stamblerre
Copy link
Contributor

Oh, I'm sorry, typo - meant to say - can you share the full gopls log?

@inliquid
Copy link
Author

inliquid commented Jul 2, 2019

Ah, ok when I next time see this error I'll share more logs.

@stamblerre stamblerre changed the title x/tools/cmd/gopls: server stucks with a lot of meaningless messages of errors x/tools/gopls: server stucks with a lot of meaningless messages of errors Jul 2, 2019
@DrGo
Copy link
Contributor

DrGo commented Jul 28, 2019

Logs from few occasions where similar behaviour happened. Thanks

➜  ~ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/salah/Library/Caches/go-build"
GOENV="/Users/salah/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/salah/go"
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="/dev/null"
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/kz/fc7nstbx16q2gvb1w6rry8cm0000gn/T/go-build012474209=/tmp/go-build -gno-record-gcc-switches -fno-common"
➜  ~ go version
go version go1.13beta1 darwin/amd64
➜  ~ gopls version
version v0.1.0-cmd.gopls, built in $GOPATH mode
➜  ~ 

gopls3.log
gopls2.log
gopls.log

@stamblerre
Copy link
Contributor

@DrGo: It looks like you are using an old version of gopls - can you please update by running go get golang.org/x/tools/gopls@latest?

@DrGo
Copy link
Contributor

DrGo commented Jul 29, 2019

Thanks Rebecca,
I updated to golang.org/x/tools/gopls v0.1.2

While using it briefly this morning, I am getting a different error that I do not understand

[Error - 9:08:03 AM] unable to check package for file:///Users/salah/local/git/core/options.go: go/packages.Load: no packages found for /Users/salah/local/git/core/options.go
[Error - 9:08:03 AM] Request textDocument/documentLink failed.
  Message: no AST for file:///Users/salah/local/git/core/options.go
  Code: 0 

I do not see anything different about this file. gopls does not complain about other files in the same package.

Also, do you know why I am getting this error when opening a mod file

[Error - 9:12:09 AM] Request textDocument/codeAction failed.
  Message: not a Go file file:///Users/salah/local/git/core/go.mod
  Code: 0 

Many thanks,

@stamblerre
Copy link
Contributor

@DrGo: For your first error, can you please share additional information as described here? In particular, what is the output of gopls -rpc.trace -v check /Users/salah/local/git/core/options.go?

Regarding the error with the go.mod file, we do not support any codeActions on go.mod files, which is why we log that error (though we probably shouldn't). I expect you would only see this error message in the logs, not in the "Problems" pane - correct?

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 5, 2019
@DrGo
Copy link
Contributor

DrGo commented Aug 10, 2019

correct.

2019/08/10 12:51:38 Info:Build info

golang.org/x/tools/gopls v0.1.2
golang.org/x/tools/gopls@v0.1.3 h1:CB5ECiPysqZrwxcyRjN+exyZpY0gODTZvNiqQi3lpeo=
golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/tools@v0.0.0-20190710153321-831012c29e42 h1:4IOeC7p+OItq3+O5BWkcmVu2uBe3jekXau5S4QZX9DU=

Go info

go version go1.13beta1 darwin/amd64

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/salah/Library/Caches/go-build"
GOENV="/Users/salah/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/salah/go"
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="/Users/salah/local/git/carpenter/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/kz/fc7nstbx16q2gvb1w6rry8cm0000gn/T/go-build098138432=/tmp/go-build -gno-record-gcc-switches -fno-common"

@stamblerre
Copy link
Contributor

Ok, in that case, I don't think that this should be a problem that necessarily needs fixing, though I did actually remove this logging in https://golang.org/cl/189039. Logged messages are just for troubleshooting, only the errors in the Problems pane should affect the user.

@inliquid
Copy link
Author

Problem is not "errors" and "logging". problem is that at the same time gopls stopped doing anything.

@stamblerre
Copy link
Contributor

@inliquid: I was replying to @DrGo's issue here. It seems to have been a different issue from the one you had experienced. Please share your gopls logs or the output of gopls -rpc.trace -v check /path/to/file.go, and I would be happy to help diagnose this issue.

@DrGo
Copy link
Contributor

DrGo commented Aug 16, 2019

@stamblerre gopls freezes in my case too forcing multiple restarts. However, I have disabled gopls so I do not know if the issue was fixed more recently.

@stamblerre
Copy link
Contributor

@DrGo: If you choose to re-enable gopls and encounter problems, please open a new issue. Thanks!

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@stamblerre
Copy link
Contributor

A lot has changed in gopls since this issue was filed, so I will close it. If you encounter new problems with gopls, please file a new issue. Thanks!

@golang golang locked and limited conversation to collaborators Oct 21, 2020
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