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

x/tools/gopls: server stucks with a lot of meaningless messages of errors #32857

inliquid opened this issue Jun 29, 2019 · 20 comments

Comments

@inliquid
Copy link

@inliquid inliquid commented Jun 29, 2019

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 label Jun 29, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 1, 2019

@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

This comment has been minimized.

Copy link
Author

@inliquid 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

This comment has been minimized.

Copy link
Author

@inliquid 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

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 1, 2019

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

This comment has been minimized.

Copy link
Author

@inliquid inliquid commented Jul 1, 2019

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

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 1, 2019

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

@inliquid

This comment has been minimized.

Copy link
Author

@inliquid inliquid commented Jul 2, 2019

Sorry, what do you mean?

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 2, 2019

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

@inliquid

This comment has been minimized.

Copy link
Author

@inliquid 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

This comment has been minimized.

Copy link

@DrGo 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

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 29, 2019

@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

This comment has been minimized.

Copy link

@DrGo 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

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 5, 2019

@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?

@DrGo

This comment has been minimized.

Copy link

@DrGo 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

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 12, 2019

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

This comment has been minimized.

Copy link
Author

@inliquid inliquid commented Aug 12, 2019

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

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 12, 2019

@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

This comment has been minimized.

Copy link

@DrGo 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

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 16, 2019

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

@gopherbot gopherbot added the Tools label Sep 12, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Oct 22, 2019

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!

@stamblerre stamblerre closed this Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.