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/cmd/gopls: wrong error messages after gopls restart inside of editor (by means of editor) #32909

Closed
inliquid opened this issue Jul 2, 2019 · 9 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@inliquid
Copy link

inliquid commented Jul 2, 2019

VS Code. After some editing I came to some strange error, and decided to restart gopls by means of editor But the thing is that after restart (no any other actions taken) there are false errors, see log below. This situation repeated each time restart feature was used (tried several times). However when I restarted whole editor, it disappeared.

[Info  - 2:01:42] Build info
----------
golang.org/x/tools/gopls v0.1.1
    golang.org/x/tools/gopls@(devel)
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20190628153133-6cdbf07be9d0 => ../

Go info
-------
go version go1.12.6 windows/amd64

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\***\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\***\go
set GOPROXY=
set GORACE=
set GOROOT=c:\go
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=c:\path\to\workdir\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\***\AppData\Local\Temp\go-build772715294=/tmp/go-build -gno-record-gcc-switches

[Error - 2:01:45] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:45] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/documentSymbol failed.
  Message: no AST for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/codeAction failed.
  Message: no file information for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/documentLink failed.
  Message: no AST for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/codeAction failed.
  Message: no file information for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:51] unable to check package for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go: no packages found for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go
[Error - 2:01:51] unable to check package for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go: no packages found for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go
[Error - 2:01:51] unable to check package for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go: no packages found for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go
@gopherbot gopherbot added this to the Unreleased milestone Jul 2, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jul 2, 2019
@stamblerre
Copy link
Contributor

This sounds like your VSCode-Go issue: microsoft/vscode-go#2633. I will close this issue in favor of that one.

@inliquid
Copy link
Author

inliquid commented Aug 6, 2019

It's clear that these issues are different. In the mentioned case there is even no gopls logs available.

@stamblerre
Copy link
Contributor

My apologies, I assumed that the error was related to one of the other issues you had filed.
Are you still seeing this issue with the latest version of gopls? We had a number of stability improvements with v0.1.3.
If you are seeing this with the latest version, please share the updated logs here.

@stamblerre stamblerre reopened this Aug 6, 2019
@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 6, 2019
@gopherbot
Copy link

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.)

@inliquid
Copy link
Author

inliquid commented Sep 6, 2019

Nice.

@jguenther
Copy link

FWIW I haven't gotten this error in the past couple days. I've been keeping up to date with the latest gopls so maybe it got fixed there somewhere

@inliquid what version/commit of gopls are you using?

@ianthehat
Copy link

I think it depends on how you restart gopls, if you use the Restart Language Server thing, it does not seem to clear out existing diagnostics, and of course the new instance of gopls knows nothing about the diagnostics that were already sent so it cannot clear them.
If you use the Reload Window option then it does not have this problem, but is a much more expensive operation.
I think this is a VSCode plugin bug not a gopls bug, but maybe we could find a way to work around it.

@inliquid
Copy link
Author

inliquid commented Sep 6, 2019

Usually (if no errors, etc) "Restart Language Server" works. This is quite rare error and I didn't see it since quite a while.

@inliquid
Copy link
Author

inliquid commented Sep 6, 2019

@jguenther I always use latest master version. Updating it regularly.

@golang golang locked and limited conversation to collaborators Sep 5, 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants