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: <gopls crashed> #39996

Closed
nicofr83 opened this issue Jul 2, 2020 · 6 comments
Closed

x/tools/gopls: <gopls crashed> #39996

nicofr83 opened this issue Jul 2, 2020 · 6 comments
Labels
Milestone

Comments

@nicofr83
Copy link

@nicofr83 nicofr83 commented Jul 2, 2020

ATTENTION: Please answer these questions BEFORE submitting your issue. Thanks!

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is better.
A failing unit test is the best.

What did you expect to see?

process goals crash.
It seems to run if I start it in terminal : goals --serve

What did you see instead?

Error message saying that goals crashed....

[Info - 9:11:55 AM] Connection to server got closed. Server will restart.
gopls: Unknown command vs-kubernetes
The Go Language source tools.

Usage: gopls [flags] [command-flags] [command-args]

gopls is a Go language server. It is typically used with an editor to provide
language features. When no command is specified, gopls will default to the 'serve'
command. The language features can also be accessed via the gopls command-line interface.

Available commands are:

main:
serve : run a server for Go code using the Language Server Protocol
version : print the gopls version information
bug : report a bug in gopls

features:
check : show diagnostic results for the specified file
definition : show declaration of selected identifier
folding_ranges : display selected file's folding ranges
format : format the code according to the go standard
highlight : display selected identifier's highlights
implementation : display selected identifier's implementation
imports : updates import statements
inspect : inspect server state (daemon mode only)
links : list links in a file
prepare_rename : test validity of a rename operation at location
references : display selected identifier's references
rename : rename selected identifier
signature : display selected identifier's signature
fix : apply suggested fixes
symbols : display selected file's symbols
workspace_symbol : search symbols in workspace

gopls flags are:

Build info

I removed all go extensions
Reinstall only the go extensions

vscode standard (not daily build) up to date
osx Catalina
go 1.14.3 (but I got this problem with go 1.14 as well)

I have the following extensions installed

docker1.31
go 0.15
Kubernetes 1.21
pgFormatter 1.14.0
remote container (ms) 0.122.1
remote-ssh/remote ssh config file v0.51
vscode position 1.0.1
yaml 0.80


golang.org/x/tools/gopls 0.4.2
    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
    golang.org/x/tools@v0.0.0-20200701133321-6ddc6be4d35f h1:0YooLLGGxVRx2qHHVzitbm1g2pS6ar7dW2nO8aEiOdA=
    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go info

go version go1.14.3 darwin/amd64

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 2, 2020

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added this to the Unreleased milestone Jul 2, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jul 2, 2020

Can you please share your VS Code settings? You can access them through the Command Palette (Ctrl + Shift + P) -> Preferences: Open Settings (JSON).

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Jul 2, 2020
@nicofr83
Copy link
Author

@nicofr83 nicofr83 commented Jul 2, 2020

Sorry, forgotten this...

{
"window.zoomLevel": 4,
"files.autoSave": "afterDelay",
"editor.formatOnSave": true,
"go.useLanguageServer": true,
"explorer.confirmDragAndDrop": false,
"typescript.updateImportsOnFileMove.enabled": "always",
"go.autocompleteUnimportedPackages": true,
"go.coverOnSave": true,
"go.coverageDecorator": {
"type": "highlight",
"coveredHighlightColor": "rgba(64,128,128,0.5)",
"uncoveredHighlightColor": "rgba(128,64,64,0.25)",
"coveredGutterStyle": "blockgreen",
"uncoveredGutterStyle": "blockred"
},
"go.coverOnSingleTest": true,
"vs-kubernetes": {
"vs-kubernetes.minikube-path.mac": "/Users/nico/.vs-kubernetes/tools/minikube/darwin-amd64/minikube",
"vs-kubernetes.helm-path.mac": "/Users/nico/.vs-kubernetes/tools/helm/darwin-amd64/helm",
"vs-kubernetes.draft-path.mac": "/Users/nico/.vs-kubernetes/tools/draft/darwin-amd64/draft"
},
"go.languageServerFlags": [
"vs-kubernetes",
"go.coverOnSave"
],
"editor.formatOnType": true,
"go.coverageOptions": "showUncoveredCodeOnly",
"go.coverOnSingleTestFile": true,
"go.lintOnSave": "file",
"merge-conflict.autoNavigateNextConflict.enabled": true,
"git.autofetch": true,
"go.formatTool": "goimports"
}

@nicofr83
Copy link
Author

@nicofr83 nicofr83 commented Jul 2, 2020

I have docker on OSX with Kubernetes...
docker v2.3.0.3
Kubernetes: v 1.16.5

Thanks

@hyangah
Copy link
Contributor

@hyangah hyangah commented Jul 2, 2020

@nicofr83 Thanks for providing the details!

According to the log , gopls crashed with an error
gopls: Unknown command vs-kubernetes.

From your settings, I see

"go.languageServerFlags": [
  "vs-kubernetes",
  "go.coverOnSave"
],

That's how gopls got the problematic arguments, and failed to start. Please remove that and try again (⇧⌘P -> Go: Restart Language Server, or Developer: Reload Window).

@nicofr83
Copy link
Author

@nicofr83 nicofr83 commented Jul 2, 2020

It is fixed,
thanks a lot, you made my day !!!
Nicolas

@nicofr83 nicofr83 closed this Jul 2, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.4 Jul 9, 2020
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.