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

cmd/go: go get panic with internal error: can't find reason #61432

Closed
Dreamacro opened this issue Jul 19, 2023 · 3 comments
Closed

cmd/go: go get panic with internal error: can't find reason #61432

Dreamacro opened this issue Jul 19, 2023 · 3 comments
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@Dreamacro
Copy link

Dreamacro commented Jul 19, 2023

What version of Go are you using (go version)?

$ go version
go version go1.20.6 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.20"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.20/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.6"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/root/projects/gopanic/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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3086296127=/tmp/go-build -gno-record-gcc-switches"

What did you do?

package main

import (
	_ "github.com/ipfs/go-ds-leveldb"
	_ "github.com/libp2p/go-libp2p-kad-dht"
)

func main() {
}

When go mod tidy is executed, the versions of the two packages are:

require (
	github.com/ipfs/go-ds-leveldb v0.5.0
	github.com/libp2p/go-libp2p-kad-dht v0.21.1
)

Try to update github.com/libp2p/go-libp2p-kad-dht, panic appears:

> go get -u github.com/libp2p/go-libp2p-kad-dht
panic: internal error: can't find reason for requirement on github.com/syndtr/goleveldb@v1.0.0

goroutine 1 [running]:
cmd/go/internal/modget.(*resolver).updateBuildList.func1({{0xc0012df380, 0x1b}, {0xc000120e26, 0x6}})
        /usr/lib/go-1.20/src/cmd/go/internal/modget/get.go:1760 +0xd4
cmd/go/internal/modget.(*resolver).updateBuildList(0xc000552000, {0xb47138, 0xc000120000}, {0xc0006ec300, 0x6, 0x8})
        /usr/lib/go-1.20/src/cmd/go/internal/modget/get.go:1765 +0x54c
cmd/go/internal/modget.(*resolver).applyUpgrades(0xc000552000, {0xb47138, 0xc000120000}, {0xc0002e4dc0?, 0x6, 0xc000127d70?})
        /usr/lib/go-1.20/src/cmd/go/internal/modget/get.go:1312 +0x465
cmd/go/internal/modget.runGet({0xb47138, 0xc000120000}, 0xc000146690?, {0xc000136030, 0x1, 0x1})
        /usr/lib/go-1.20/src/cmd/go/internal/modget/get.go:351 +0x458
main.invoke(0xe5f400, {0xc000136010, 0x3, 0x3})
        /usr/lib/go-1.20/src/cmd/go/main.go:225 +0x3d9
main.main()
        /usr/lib/go-1.20/src/cmd/go/main.go:179 +0x7ce

What did you expect to see?

Successful update

What did you see instead?

Go panic

@seankhliao
Copy link
Member

fixed in 1.21rc3 / tip

@dmitshur dmitshur added this to the Go1.21 milestone Jul 21, 2023
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go labels Jul 21, 2023
@AskAlexSharov
Copy link

@seankhliao hello. Don't need backport fix to go1.20 ?

@seankhliao
Copy link
Member

seankhliao commented Aug 23, 2023

no, see #57358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants