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: cannot load <package>, disallowed version string "" #32636

Closed
zikaeroh opened this issue Jun 15, 2019 · 9 comments
Closed

cmd/go: cannot load <package>, disallowed version string "" #32636

zikaeroh opened this issue Jun 15, 2019 · 9 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@zikaeroh
Copy link
Contributor

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

$ go version
go version devel +06e34e5 Sat Jun 15 14:23:04 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

Not in 1.12.5, yes on tip.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jake/nobackup/gotip_home/cache/go-build"
GOENV="/home/jake/nobackup/gotip_home/config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jake/nobackup/gotip_home/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/jake/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/jake/sdk/gotip/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/jake/decbug/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build227879872=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go.mod:

module decbug

go 1.12

main.go:

package main

import _ "github.com/ericlagergren/decimal"

func main() {}

Run go build.

What did you expect to see?

No errors on building, dependencies populated, etc.

What did you see instead?

go build fails with:

go: finding github.com/ericlagergren/decimal latest
go: finding github.com/ericlagergren/decimal 
build decbug: cannot load github.com/ericlagergren/decimal: disallowed version string ""

Running go mod tidy always outputs:

go: finding github.com/ericlagergren/decimal latest
go: finding github.com/ericlagergren/decimal 

go build in 1.12.5 works fine, along with mod tidy, etc.

@Azareal
Copy link

Azareal commented Jun 15, 2019

go get github.com/mailru/easyjson/...: disallowed version string ""
The same thing seems to happen with go get -u github.com/mailru/easyjson/...

Is this deliberate or an accidental break?

@zikaeroh
Copy link
Contributor Author

Bisects to CL 180337 (4c2ffd2).

@mvdan
Copy link
Member

mvdan commented Jun 16, 2019

I have been encountering the same error in the last couple of days on master. I didn't file an issue because I thought I was doing something silly. Using 1.12.6 let me work around the issue when adding new dependencies.

This probably needs more investigation, but for now I'm adding it as a 1.13 release blocker. CC @jayconrod @bcmills

@mvdan mvdan added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Jun 16, 2019
@mvdan mvdan added this to the Go1.13 milestone Jun 16, 2019
@eliasnaur
Copy link
Contributor

FWIW, I had a similar same error message and setting GOPROXY=direct fixed the problem. I didn't investigate why.

@jayconrod jayconrod self-assigned this Jun 17, 2019
@jayconrod jayconrod added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 17, 2019
@jayconrod
Copy link
Contributor

Reproduced. Will look into this today.

@cuonglm
Copy link
Member

cuonglm commented Jun 17, 2019

@jayconrod The problem is the empty "" current param passed to queryProxy, which causes module.EncodeVersion return error.

@gopherbot
Copy link

Change https://golang.org/cl/182697 mentions this issue: cmd/go/internal/modload: query correct "latest" version through proxy

@zikaeroh
Copy link
Contributor Author

The above CL seems to fix the issue in my projects. Thanks!

@jayconrod
Copy link
Contributor

@zikaeroh Thanks for verifying, and thanks for reporting the issue. The fix is merged now. Sorry for the break.

@golang golang locked and limited conversation to collaborators Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

7 participants