-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: fails on filepaths with spaces #34270
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting section of the gopls Wiki page, and make sure that you have provided all of the relevant information here. |
Could you provide some more information about what you did? |
I have the exact same issue and after some time debugging it turns out the issue is having a space in your directory structure. As far as I can tell from your output you have the following structure |
while investigating this a bit(I am 100% new to doing anything with gopls) it seems that in a lot of places the file-locations are either url encoded(" " is replaced with %20) and others it is not creating conflicts in many ways. |
I’m using vs code editor on Mac.
My source files are on iCloud Drive. That’s where you see the space on the folder name. But I have a symbolic link to the file from a proper directory. Not sure that makes any difference.
That’s it. Making changes to the file with the editor triggers gopls. That’s when I get the error of the crash.
… On Sep 14, 2019, at 4:20 AM, JAicewizard ***@***.***> wrote:
Could you provide some more information about what you did?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I can confirm that it does not work when using the iCloud directory. My guess is it either doesn't work due to the space encoded The relevant line from the log:
|
CL 195518 will have fixed the nil pointer, but yes it looks there is an issue with the |
Change https://golang.org/cl/195618 mentions this issue: |
I wasn't sure if we should just manually construct the URI here or use the URL unescaping function. Let me know which you think is best. Updates golang/go#34270 Change-Id: Idb48fc2650d39f3e54cac141a70f356c31e303ad Reviewed-on: https://go-review.googlesource.com/c/tools/+/195618 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Ian Cottrell <[email protected]>
Just tagged a new version of |
I wasn't sure if we should just manually construct the URI here or use the URL unescaping function. Let me know which you think is best. Updates golang/go#34270 Change-Id: Idb48fc2650d39f3e54cac141a70f356c31e303ad Reviewed-on: https://go-review.googlesource.com/c/tools/+/195618 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Ian Cottrell <[email protected]>
Info - 1:16:04 PM] 2019/09/12 13:16:04 Build info
golang.org/x/tools/gopls v0.1.5
golang.org/x/tools/[email protected] h1:bfyquCQT+XBur/qfeq64IXf1fv54Kh4y6/tDWA31M3g=
golang.org/x/[email protected] h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/[email protected] h1:4m1a+ssoIi4N/776T3Dc79eRjDc5sEhMQXFAKoO3TM8=
golang.org/x/[email protected] h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
Go info
go version go1.13 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/fabrizio/Library/Caches/go-build"
GOENV="/Users/fabrizio/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/fabrizio/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/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3/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/t3/bmtk93rn4_d9t8ybmnrb5qwm0000gq/T/go-build515512987=/tmp/go-build -gno-record-gcc-switches -fno-common"
[Info - 1:16:04 PM] 2019/09/12 13:16:04 24.638118ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "env" "GOMOD", stderr: <<>>[Info - 1:16:04 PM] 2019/09/12 13:16:04 60.026984ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "builtin", stderr: <<>>[Info - 1:16:04 PM] 2019/09/12 13:16:04 85.624693ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "list" "-m" "-json" "all", stderr: <<>>[Info - 1:16:04 PM] 2019/09/12 13:16:04 27.643196ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "env" "GOMOD", stderr: <<>>[Info - 1:16:04 PM] 2019/09/12 13:16:04 102.18129ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "list" "-m" "-json" "all", stderr: <<>>[Info - 1:16:04 PM] 2019/09/12 13:16:04 343.526148ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "/Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3", stderr: <<>>[Info - 1:16:04 PM] 2019/09/12 13:16:04 go/packages.Load
packages = 1
[Info - 1:16:04 PM] 2019/09/12 13:16:04 go/packages.Load
package = github.com/fblanco/gcs_to_gbq_V3
files = [/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3/pull.go /Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3/receiver_queue.go /Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3/scheduler.go /Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3/schema.go][Info - 1:16:04 PM] 2019/09/12 13:16:04 22.558159ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "env" "GOMOD", stderr: <<>>[Info - 1:16:04 PM] 2019/09/12 13:16:04 60.059133ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "list" "-m" "-json" "all", stderr: <<>>[Info - 1:16:05 PM] 2019/09/12 13:16:05 372.406579ms for GOROOT=/usr/local/go GOPATH=/Users/fabrizio/go GO111MODULE= PWD=/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3 go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "/Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3", stderr: <<>>[Info - 1:16:05 PM] 2019/09/12 13:16:05 go/packages.Load
packages = 1
[Info - 1:16:05 PM] 2019/09/12 13:16:05 go/packages.Load
package = github.com/fblanco/gcs_to_gbq_V3
files = [/Users/fabrizio/Library/Mobile Documents/com
appleCloudDocs/Code/fblanco/gcs_to_gbq_V3/pull.go /Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3/receiver_queue.go /Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3/scheduler.go /Users/fabrizio/Library/Mobile Documents/comappleCloudDocs/Code/fblanco/gcs_to_gbq_V3/schema.go][Error - 1:16:05 PM] Request textDocument/documentSymbol failed.
Message: method "textDocument/documentSymbol" did not reply
Code: -32603
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x13b34f6]
goroutine 7 [running]:
golang.org/x/tools/internal/lsp/source.pkgToMapper(0x18112c0, 0xc000298000, 0x181c260, 0xc0002d0000, 0x181c1c0, 0xc0001892c0, 0xc009204380, 0x68, 0x0, 0xc000418077, ...)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/util.go:126 +0x116
golang.org/x/tools/internal/lsp/source.cachedFileToMapper(0x18112c0, 0xc000298000, 0x181c260, 0xc0002d0000, 0xc009204380, 0x68, 0x19, 0x1, 0x1, 0x203002)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/util.go:112 +0x19e
golang.org/x/tools/internal/lsp/source.posToRange(0x18112c0, 0xc000298000, 0x181c260, 0xc0002d0000, 0x6bc9, 0x6bec, 0x0, 0x0, 0x0, 0x0, ...)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/util.go:226 +0x1a6
golang.org/x/tools/internal/lsp/source.nodeToMappedRange(0x18112c0, 0xc000298000, 0x181c260, 0xc0002d0000, 0x1807180, 0xc000a100c0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/util.go:215 +0xd8
golang.org/x/tools/internal/lsp/source.nodeToProtocolRange(0x18112c0, 0xc000298000, 0x181c260, 0xc0002d0000, 0x1807180, 0xc000a100c0, 0xc0002532c0, 0x100f9d6, 0x10138b2, 0xc0002532c0, ...)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/util.go:184 +0x81
golang.org/x/tools/internal/lsp/source.varSymbol(0x18112c0, 0xc000298000, 0x181c260, 0xc0002d0000, 0x1807180, 0xc000a100c0, 0xc0009c6380, 0x181cda0, 0xc009360780, 0xc00843db00, ...)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/symbols.go:278 +0x133
golang.org/x/tools/internal/lsp/source.DocumentSymbols(0x18112c0, 0xc000298000, 0x181c260, 0xc0002d0000, 0x181ac20, 0xc0004102d0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/symbols.go:66 +0x53d
golang.org/x/tools/internal/lsp.(*Server).documentSymbol(0xc000220600, 0x18112c0, 0xc0003c5710, 0xc00040d2c0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/symbols.go:26 +0x21a
golang.org/x/tools/internal/lsp.(*Server).DocumentSymbol(0xc000220600, 0x1811200, 0xc000031d80, 0xc00040d2c0, 0xc00040d2c0, 0x0, 0x0, 0x510dc00, 0x100)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/server.go:196 +0x4d
golang.org/x/tools/internal/lsp/protocol.serverHandler.Deliver(0x1822ec0, 0xc000220600, 0x1811200, 0xc000031d80, 0xc000031dc0, 0x0, 0xc0000b0001)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/lsp/protocol/tsserver.go:389 +0x3c4d
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc0000a44e0, 0xc000031dc0, 0xc000220660, 0x1811200, 0xc000031d80, 0x0, 0x0, 0xc000069d50)
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/jsonrpc2/jsonrpc2.go:370 +0x170
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
/Users/fabrizio/go/pkg/mod/golang.org/x/[email protected]/internal/jsonrpc2/jsonrpc2.go:354 +0x86a
[Error - 1:16:05 PM] Connection to server got closed. Server will not be restarted.
[Error - 1:16:05 PM] Request textDocument/codeAction failed.
Error: Connection got disposed.
at Object.dispose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/main.js:876:25)
at Object.dispose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:57:35)
at LanguageClient.handleConnectionClosed (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:2036:42)
at LanguageClient.handleConnectionClosed (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/main.js:127:15)
at closeHandler (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:2023:18)
at CallbackList.invoke (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:120:36)
at closeHandler (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/main.js:226:26)
at CallbackList.invoke (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:120:36)
at StreamMessageReader.fireClose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/messageReader.js:111:27)
at Socket.listen.readable.on (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/messageReader.js:151:46)
at Socket.emit (events.js:187:15)
at Pipe.Socket._destroy._handle.close (net.js:606:12)
[Error - 1:16:05 PM] Request textDocument/documentLink failed.
Error: Connection got disposed.
at Object.dispose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/main.js:876:25)
at Object.dispose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:57:35)
at LanguageClient.handleConnectionClosed (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:2036:42)
at LanguageClient.handleConnectionClosed (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/main.js:127:15)
at closeHandler (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:2023:18)
at CallbackList.invoke (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:120:36)
at closeHandler (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/main.js:226:26)
at CallbackList.invoke (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:120:36)
at StreamMessageReader.fireClose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/messageReader.js:111:27)
at Socket.listen.readable.on (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/messageReader.js:151:46)
at Socket.emit (events.js:187:15)
at Pipe.Socket._destroy._handle.close (net.js:606:12)
[Error - 1:16:05 PM] Request textDocument/foldingRange failed.
Error: Connection got disposed.
at Object.dispose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/main.js:876:25)
at Object.dispose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:57:35)
at LanguageClient.handleConnectionClosed (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:2036:42)
at LanguageClient.handleConnectionClosed (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/main.js:127:15)
at closeHandler (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-languageclient/lib/client.js:2023:18)
at CallbackList.invoke (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:120:36)
at closeHandler (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/main.js:226:26)
at CallbackList.invoke (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/events.js:120:36)
at StreamMessageReader.fireClose (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/messageReader.js:111:27)
at Socket.listen.readable.on (/Users/fabrizio/.vscode/extensions/ms-vscode.go-0.11.4/node_modules/vscode-jsonrpc/lib/messageReader.js:151:46)
at Socket.emit (events.js:187:15)
at Pipe.Socket._destroy._handle.close (net.js:606:12)
The text was updated successfully, but these errors were encountered: