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
Assignees
Milestone

Comments

@zikaeroh
Copy link

@zikaeroh zikaeroh commented Jun 15, 2019

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

This comment has been minimized.

Copy link

@Azareal 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

This comment has been minimized.

Copy link
Author

@zikaeroh zikaeroh commented Jun 15, 2019

Bisects to CL 180337 (4c2ffd2).

@mvdan

This comment has been minimized.

Copy link
Member

@mvdan 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 this to the Go1.13 milestone Jun 16, 2019
@eliasnaur

This comment has been minimized.

Copy link
Contributor

@eliasnaur eliasnaur commented Jun 17, 2019

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

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Jun 17, 2019

Reproduced. Will look into this today.

@cuonglm

This comment has been minimized.

Copy link
Contributor

@cuonglm cuonglm commented Jun 17, 2019

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

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 17, 2019

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

@zikaeroh

This comment has been minimized.

Copy link
Author

@zikaeroh zikaeroh commented Jun 17, 2019

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

@gopherbot gopherbot closed this in 53f628e Jun 18, 2019
@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Jun 18, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.