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 github.com/nats-io/go-nats fails with default GOPROXY and modules set #36362

Closed
tmeresinski opened this issue Jan 2, 2020 · 1 comment

Comments

@tmeresinski
Copy link

@tmeresinski tmeresinski commented Jan 2, 2020

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

$ go version
go version go1.13.4 linux/amd64

Does this issue reproduce with the latest release?

Yes (in rc-alpine docker image)

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tomek/.cache/go-build"
GOENV="/home/tomek/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/tmp/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build526628754=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Command

GO111MODULE=on go get github.com/nats-io/go-nats
fails with error:

go: finding github.com/nats-io/go-nats v1.8.1
go: downloading github.com/nats-io/go-nats v1.8.1
go: extracting github.com/nats-io/go-nats v1.8.1
go get: github.com/nats-io/go-nats@v1.8.1: parsing go.mod:
        module declares its path as: github.com/nats-io/nats.go
                but was required as: github.com/nats-io/go-nats

What is interesting, there's no v1.8.1 tag in go-nats repo (it ends with 1.7.2), but it is in nats.go.
With GOPROXY=direct everything works.

@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Jan 2, 2020

The origin repository doesn't have v1.8.1, but that version must have existed at some point. It's included in the list at https://proxy.golang.org/github.com/nats-io/go-nats/@v/list, so go get will pick that as the latest version when using the proxy (by default). It won't connect to the origin repository if a module is available on the proxy, so it won't know this version was deleted.

At the moment, there's no process for un-publishing a version from the proxy. For the most part, we want versions to remain available in their original form even if the source repositories are modified or deleted. Of course there are good reasons for un-publishing versions; #24031 discusses this, and we may eventually have a solution.

For now, you can use the canonical name (go get github.com/nats-io/nats.go) or use a specific older version (go get github.com/nats-io/go-nats@v1.7.2).

@jayconrod jayconrod closed this Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.