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

Language server fails to start #2909

Closed
PSalant726 opened this issue Aug 2, 2023 · 5 comments
Closed

Language server fails to start #2909

PSalant726 opened this issue Aug 2, 2023 · 5 comments
Milestone

Comments

@PSalant726
Copy link

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • macOS Sonoma public beta 2, build 23A5301h

  • Run go version to get version of Go from the VS Code integrated terminal.

    • go version go1.20.7 darwin/arm64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.

    $ gopls -v version
    [1]    39756 segmentation fault  gopls -v version
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.

    $ code -v
    1.80.2
    2ccd690cbff1569e4a83d7c43d45101f817401dc
    arm64
  • Check your installed extensions to get the version of the VS Code Go extension

    • v0.39.1
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.

     Checking configured tools....
     GOBIN: /Users/{{REDACTED}}/go/bin
     toolsGopath: 
     gopath: /Users/{{REDACTED}}/go
     GOROOT: /opt/homebrew/Cellar/go/1.20.7/libexec
     PATH: /Users/{{REDACTED}}/go/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/MacGPG2/bin:/opt/homebrew/opt/fzf/bin
    
     	go:	/opt/homebrew/bin/go: go version go1.20.7 darwin/arm64
    
     	gotests:	/Users/{{REDACTED}}/go/bin/gotests	(version: v1.6.0 built with go: go1.20.7)
     	gomodifytags:	/Users/{{REDACTED}}/go/bin/gomodifytags	(version: v1.16.0 built with go: go1.20.7)
     	impl:	/Users/{{REDACTED}}/go/bin/impl	(version: v1.1.0 built with go: go1.20.7)
     	goplay:	/Users/{{REDACTED}}/go/bin/goplay	(version: v1.0.0 built with go: go1.20.7)
     	dlv:	/Users/{{REDACTED}}/go/bin/dlv	(version: v1.21.0 built with go: go1.20.7)
     	golangci-lint:	/Users/{{REDACTED}}/go/bin/golangci-lint	(version: v1.51.0 built with go: go1.20.4)
     	gopls:	/Users/{{REDACTED}}/go/bin/gopls	(version: v0.13.1 built with go: go1.20.7)
    
     go env
     Workspace Folder ({{REDACTED}}): /Users/{{REDACTED}}
     	GO111MODULE=""
     	GOARCH="arm64"
     	GOBIN="/Users/{{REDACTED}}/go/bin"
     	GOCACHE="/Users/{{REDACTED}}/Library/Caches/go-build"
     	GOENV="/Users/{{REDACTED}}/Library/Application Support/go/env"
     	GOEXE=""
     	GOEXPERIMENT=""
     	GOFLAGS=""
     	GOHOSTARCH="arm64"
     	GOHOSTOS="darwin"
     	GOINSECURE=""
     	GOMODCACHE="/Users/{{REDACTED}}/go/pkg/mod"
     	GONOPROXY=""
     	GONOSUMDB=""
     	GOOS="darwin"
     	GOPATH="/Users/{{REDACTED}}/go"
     	GOPRIVATE=""
     	GOPROXY="https://proxy.golang.org,direct"
     	GOROOT="/opt/homebrew/Cellar/go/1.20.7/libexec"
     	GOSUMDB="sum.golang.org"
     	GOTMPDIR=""
     	GOTOOLDIR="/opt/homebrew/Cellar/go/1.20.7/libexec/pkg/tool/darwin_arm64"
     	GOVCS=""
     	GOVERSION="go1.20.7"
     	GCCGO="gccgo"
     	AR="ar"
     	CC="cc"
     	CXX="c++"
     	CGO_ENABLED="1"
     	GOMOD="/Users/{{REDACTED}}/go.mod"
     	GOWORK=""
     	CGO_CFLAGS="-O2 -g"
     	CGO_CPPFLAGS=""
     	CGO_CXXFLAGS="-O2 -g"
     	CGO_FFLAGS="-O2 -g"
     	CGO_LDFLAGS="-O2 -g"
     	PKG_CONFIG="pkg-config"
     	GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bj/g9s4csxn0133kb42jm0kn7jh0000gn/T/go-build3554745612=/tmp/go-build -gno-record-gcc-switches -fno-common"
    

Share the Go related settings you have added/edited

"go.coverOnTestPackage": false,
"go.inlayHints.constantValues": true,
"go.lintFlags": [
	"--fast",
	"--max-same-issues=0"
],
"go.lintTool": "golangci-lint",
"go.playground": {
	"run": false
},
"go.showWelcome": false,
"go.testFlags": [
	"-count=1",
	"-cover"
],
"go.toolsManagement.autoUpdate": true,
"gopls": {
	"ui.codelenses": {
		"generate": false
	},
	"ui.completion.usePlaceholders": true,
	"ui.diagnostic.analyses": {
		"nilness": true,
		"unusedparams": true,
		"unusedvariable": true,
		"useany": true
	},
	"ui.noSemanticNumber": true,
	"ui.noSemanticString": true,
	"ui.semanticTokens": true
}

Describe the bug

The gopls client fails to connect to the server. Immediately upon starting VSCode there are 3 notifications produced:

  1. gopls client: couldn't create connection to server.
  2. The gopls server failed to initialize.
  3. gopls has crashed, but you are using an outdated version. Please update to the latest version of gopls.

Clicking "Go to output" reveals only the following:

fatal: morestack on g0
[Info  - 5:25:34 PM] 
true
[Error - 5:25:34 PM] gopls client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
fatal: morestack on g0
[Error - 5:25:34 PM] The gopls server failed to initialize.
[Error - 5:25:34 PM] gopls client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Error starting language server: Error: Pending response rejected since connection got disposed

Steps to reproduce the behavior:

  1. Install macOS Sonoma public beta 2
  2. Install VSCode, the Go extension
  3. Configure the extension as described above
  4. Observe the error upon startup
@gopherbot gopherbot added this to the Untriaged milestone Aug 2, 2023
@PSalant726
Copy link
Author

PSalant726 commented Aug 2, 2023

Note:

golangci-lint:	/Users/{{REDACTED}}/go/bin/golangci-lint	(version: v1.51.0 built with go: go1.20.4)

This may be related to the larger client/server connection error? I have also opened golangci/golangci-lint#3984 to investigate installation issues with golangci-lint@latest using go install. As a test, I have tried changing my linter to staticcheck, but that doesn't seem to have made any difference.

@PSalant726
Copy link
Author

Closing as a duplicate of golang/go#61190. See also: golang/go#61229.

@PSalant726 PSalant726 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
@lwdupont
Copy link

lwdupont commented Aug 3, 2023

btw, this might be caused by having the latest Xcode 15 beta installed. I just removed that and went back to 14 and things are working great for me. (I was getting the exact same error).

@sahilsk11
Copy link

@lwdupont how did you do this? this is going to be a really common issue as more people upgrade macOS and unknowingly break their go setup

@PSalant726
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants