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

gopls: panic with invalid Go version #3276

Closed
wevertonrs opened this issue Mar 22, 2024 · 5 comments
Closed

gopls: panic with invalid Go version #3276

wevertonrs opened this issue Mar 22, 2024 · 5 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@wevertonrs
Copy link

gopls version: v0.15.2/go1.20.4
gopls flags:
update flags: proxy
extension version: 0.41.2
environment: Visual Studio Code win32
initialization error: undefined
issue timestamp: Fri, 22 Mar 2024 22:38:21 GMT
restart history:
Fri, 22 Mar 2024 22:37:29 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: invalid Go version "go1.22.1" (should be something like "go1.12")

goroutine 624 [running]:
go/types.NewChecker(0x0%3F, 0xc0011400c0, 0xc0017ce7d0, 0x0%3F)
	C:/Program   check.go:237  0x24e
golang.org/x/tools/gopls/internal/cache.(*analysisNode).typeCheck(0xc000afa0b0, {0xc00000aa28, 0x1, 0x1})
	  analysis.go:1028  0x73d
golang.org/x/tools/gopls/internal/cache.(*analysisNode).run(0xc000afa0b0, {0x1db9438%3F, 0xc00061d050})
	  analysis.go:810  0x218
golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0xc000afa0b0, {0x1db9438%3F, 0xc00061d050})
	  analysis.go:672  0x145
golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
	  analysis.go:398  0xda
golang.org/x/sync/errgroup.(*Group).Go.func1()
	  errgroup.go:78  0x64
created by golang.org/x/sync/errgroup.(*Group).Go
	  errgroup.go:75  0xa5
gopls stats -anon { "DirStats": { "Files": 34, "TestdataFiles": 0, "GoFiles": 5, "ModFiles": 1, "Dirs": 20 }, "GOARCH": "amd64", "GOOS": "windows", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.20.4", "GoplsVersion": "v0.15.2", "InitialWorkspaceLoadDuration": "4.0224353s", "MemStats": { "HeapAlloc": 8825880, "HeapInUse": 16572416, "TotalAlloc": 98190112 }, "WorkspaceStats": { "Files": { "Total": 493, "Largest": 210104, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.1", "AllPackages": { "Packages": 67, "LargestPackage": 148, "CompiledGoFiles": 491, "Modules": 1 }, "WorkspacePackages": { "Packages": 5, "LargestPackage": 2, "CompiledGoFiles": 6, "Modules": 1 }, "Diagnostics": 0 } ] } }

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>

@gopherbot gopherbot added this to the Untriaged milestone Mar 22, 2024
@suzmue suzmue changed the title gopls: automated issue report (crash) gopls: panic with invalid Go version Mar 25, 2024
@suzmue
Copy link
Contributor

suzmue commented Mar 25, 2024

This was fixed in https://go.dev/cl/507975. To get this fix we recommend upgrading to go1.21 or later

@suzmue suzmue closed this as completed Mar 25, 2024
@Alfahan
Copy link

Alfahan commented Mar 26, 2024

Okey thanks!

@tvendelin
Copy link

The error message says

panic: invalid Go version "go1.22.1" (should be something like "go1.12")

but this IS the current version, according to https://go.dev/doc/install , isn't it?
I've upgraded my Go today, and hitting this error every time I launch Neovim.

@suzmue
Copy link
Contributor

suzmue commented Mar 28, 2024

Can you try reinstalling gopls with the newer go version? It appears to be built with go1.20.4.
Running go install golang.org/x/tools/gopls@latest where go is go1.22.1 should reinstall with the newer toolchain.

After running you can verify that the go version is go1.22.1 by running the following:

$ gopls -v version

Please let me know if that works!

@suzmue suzmue reopened this Mar 28, 2024
@suzmue suzmue added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 28, 2024
@tvendelin
Copy link

tvendelin commented Apr 2, 2024

@suzmue : Indeed, after installing gopls explicitly, the issue is gone.
A few things that were confusing to me:

  • I have just upgraded to the latest Go version and falsely assumed the upgraded gopls comes with it
  • Your bug report form allows only a single line for gopls version, so I've assumed that's all you want.

Thank you, and sorry for confusion.

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants