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: crashes on gitlens files #40272

Open
leguminosa opened this issue Jul 17, 2020 · 4 comments
Open

x/tools/gopls: crashes on gitlens files #40272

leguminosa opened this issue Jul 17, 2020 · 4 comments
Labels
Milestone

Comments

@leguminosa
Copy link

@leguminosa leguminosa commented Jul 17, 2020

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Please attach the stack trace from the crash.
A window with the error message should have popped up in the lower half of your screen.
Please copy the stack trace from that window and paste it in this issue.

panic: only file URIs are supported, got "gitlens" from "gitlens://7d8440e/home/nakama/workspace/tokopedia/rechargeapp?%7B%22path%22%3A%22%2Fhome%2Fnakama%2Fworkspace%2Ftokopedia%2Frechargeapp%22%2C%22ref%22%3A%227d8440ea48c374823952895e01eddef8328d2a3f%22%2C%22repoPath%22%3A%22%2Fhome%2Fnakama%2Fworkspace%2Ftokopedia%2Frechargeapp%22%7D"

goroutine 90 [running]:
golang.org/x/tools/internal/span.URI.Filename(...)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/span/uri.go:32
golang.org/x/tools/internal/lsp/cache.(*View).setBuildInformation(0xc0002d0000, 0xea7e80, 0xc00036e720, 0xc00032c000, 0x11a, 0xc0002ce000, 0x71, 0x71, 0x1, 0x5f5e100, ...)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/cache/view.go:746 +0x4ba
golang.org/x/tools/internal/lsp/cache.(*Session).createView(0xc00017c600, 0xea7e80, 0xc00036e720, 0xc000322a20, 0x15, 0xc00032c000, 0x11a, 0x4000000000000000, 0x10101, 0xc0002fd788, ...)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/cache/session.go:157 +0x4d5
golang.org/x/tools/internal/lsp/cache.(*Session).NewView(0xc00017c600, 0xea7e80, 0xc00036e720, 0xc000322a20, 0x15, 0xc00032c000, 0x11a, 0x4000000000000000, 0x10101, 0xc0002fd788, ...)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/cache/session.go:108 +0x13c
golang.org/x/tools/internal/lsp.(*Server).addView(0xc0002a7b80, 0xea7e80, 0xc00036e720, 0xc000322a20, 0x15, 0xc00032c000, 0x11a, 0xebbf00, 0xc0002d02c0, 0xebd640, ...)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/workspace.go:42 +0x1e4
golang.org/x/tools/internal/lsp.(*Server).addFolders(0xc0002a7b80, 0xea7e80, 0xc00036e720, 0xc0002a7e00, 0x2, 0x4)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/general.go:191 +0x184
golang.org/x/tools/internal/lsp.(*Server).initialized(0xc0002a7b80, 0xea7e80, 0xc00036e720, 0x1416e18, 0x0, 0x0)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/general.go:179 +0x280
golang.org/x/tools/internal/lsp.(*Server).Initialized(0xc0002a7b80, 0xea7e80, 0xc00036e720, 0x1416e18, 0x1416e18, 0x0)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/server_gen.go:112 +0x49
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0xea7e80, 0xc00036e720, 0xec6080, 0xc0002a7b80, 0xc0001d3c50, 0x7fe93c608650, 0xc00036e6c0, 0x0, 0x0, 0xbfbc7a3def255911)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/protocol/tsserver.go:92 +0xa49
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0xea7e80, 0xc00036e720, 0xc0001d3c50, 0x7fe93c608650, 0xc00036e6c0, 0x0, 0x0)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/protocol/protocol.go:62 +0xc0
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0xea7e80, 0xc00036e720, 0xc0001d3c50, 0x7fe93c608650, 0xc00036e6c0, 0x0, 0x0)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/lsp/lsprpc/lsprpc.go:509 +0x43a
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0xea7e80, 0xc00036e720, 0xc000378340, 0x7fe93c608650, 0xc00036e6c0, 0x4074ef, 0xc000238658)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/jsonrpc2/handler.go:35 +0xd3
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc000238ba0, 0xc00036eb40, 0xc0002a3810, 0xea7e80, 0xc00036e720, 0xc000378340, 0x7fe93c608650, 0xc00036e6c0)
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/jsonrpc2/handler.go:103 +0x86
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
/home/nakama/.gvm/pkgsets/go1.13/global/pkg/mod/golang.org/x/tools@v0.0.0-20200708181441-6004c8539734/internal/jsonrpc2/handler.go:100 +0x171
[Error - 4:38:00 PM] Connection to server got closed. Server will not be restarted.
[Error - 4:38:00 PM] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:74:35)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2309:42)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/main.js:155:15)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2296:18)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at StreamMessageWriter.fireClose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:39:27)
at Socket. (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:58:46)
at Socket.emit (events.js:203:13)
at Pipe. (net.js:588:12)
[Error - 4:38:00 PM] Request textDocument/codeAction failed.
Error: Connection got disposed.
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:74:35)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2309:42)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/main.js:155:15)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2296:18)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at StreamMessageWriter.fireClose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:39:27)
at Socket. (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:58:46)
at Socket.emit (events.js:203:13)
at Pipe. (net.js:588:12)
[Error - 4:38:00 PM] Request textDocument/documentLink failed.
Error: Connection got disposed.
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:74:35)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2309:42)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/main.js:155:15)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2296:18)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at StreamMessageWriter.fireClose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:39:27)
at Socket. (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:58:46)
at Socket.emit (events.js:203:13)
at Pipe. (net.js:588:12)
[Error - 4:38:00 PM] Request textDocument/foldingRange failed.
Error: Connection got disposed.
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:74:35)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2309:42)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/main.js:155:15)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2296:18)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at StreamMessageWriter.fireClose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:39:27)
at Socket. (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:58:46)
at Socket.emit (events.js:203:13)
at Pipe. (net.js:588:12)
[Error - 4:38:00 PM] Request textDocument/codeLens failed.
Error: Connection got disposed.
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at Object.dispose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:74:35)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2309:42)
at LanguageClient.handleConnectionClosed (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/main.js:155:15)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2296:18)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at StreamMessageWriter.fireClose (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:39:27)
at Socket. (/home/nakama/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:58:46)
at Socket.emit (events.js:203:13)
at Pipe. (net.js:588:12)

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jul 17, 2020

Thank you for the report!

/cc @heschik because I believe you looked into gitlens files at some point? Based on the crash, it looks like the entire workspace root is a gitlens file, though I don't really understand how that works.

@stamblerre stamblerre transferred this issue from golang/vscode-go Jul 17, 2020
@stamblerre stamblerre changed the title gopls: automated issue report (crash) x/tools/gopls: crashes on gitlens file Jul 17, 2020
@stamblerre stamblerre changed the title x/tools/gopls: crashes on gitlens file x/tools/gopls: crashes on gitlens files Jul 17, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jul 17, 2020
@stamblerre stamblerre removed this from the Unreleased milestone Jul 17, 2020
@leguminosa
Copy link
Author

@leguminosa leguminosa commented Jul 20, 2020

yes it's true, when opening changes with previous revision, I accidentally pressed Explore Repository from Revision and everytime my repo is in that "state" (older revisions), gopls will panic.

The thing is, I don't know how to "undo" that state and return to normal state and from eamodio/vscode-gitlens#997 the gitlens itself stated that you cannot return to normal state, thus gopls will stuck in its panic state right at the start of vscode running and renders it unusable.

It's a certainty that this gopls and gitlens have something ...

@hyangah
Copy link
Contributor

@hyangah hyangah commented Jul 23, 2020

gitlens implements a custom file system provider using vscode's FileSystemProvider API on top of git.

Not sure how much go list can handle the partial info.

There are other document schemes https://github.com/eamodio/vscode-gitlens/blob/master/src/constants.ts#L54 but I don't know how others interact with editors and potentially triggers requests to the language server.

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 24, 2020

Change https://golang.org/cl/244602 mentions this issue: internal/lsp: check URIs of all workspace folders

gopherbot pushed a commit to golang/tools that referenced this issue Jul 28, 2020
We can prevent crashing on non-file URIs by checking the URIs of the
workspace folders, as well as the root URI.

Updates golang/go#40272

Change-Id: Ieddc6d6053fbb3d61e4c26fc8831c092328f6f33
Reviewed-on: https://go-review.googlesource.com/c/tools/+/244602
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.