Skip to content

cmd/go: get fail with private and subdirectory repo in module mode #29470

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

Closed
eraac opened this issue Dec 30, 2018 · 3 comments
Closed

cmd/go: get fail with private and subdirectory repo in module mode #29470

eraac opened this issue Dec 30, 2018 · 3 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@eraac
Copy link

eraac commented Dec 30, 2018

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

$ go version
go version go1.11.4 darwin/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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/username/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kevin/code/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.4/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/username/code/go/src/gitlab.com/xxxx/yyyy/zzzz/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/43/45xhjfkn0xbbr4flsgzh879h0000gn/T/go-build365622910=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

GO111MODULE=on go get -v gitlab.com/cyclesinfos/client/api

What did you expect to see?

No errors and module correctly imported

What did you see instead?

Fetching https://gitlab.com/cyclesinfos/client/api?go-get=1
Parsing meta tags from https://gitlab.com/cyclesinfos/client/api?go-get=1 (status code 200)
get "gitlab.com/cyclesinfos/client/api": found meta tag get.metaImport{Prefix:"gitlab.com/cyclesinfos/client", VCS:"git", RepoRoot:"https://gitlab.com/cyclesinfos/client.git"} at https://gitlab.com/cyclesinfos/client/api?go-get=1
get "gitlab.com/cyclesinfos/client/api": verifying non-authoritative meta tag
Fetching https://gitlab.com/cyclesinfos/client?go-get=1
Parsing meta tags from https://gitlab.com/cyclesinfos/client?go-get=1 (status code 200)
Fetching https://gitlab.com/cyclesinfos/client?go-get=1
Parsing meta tags from https://gitlab.com/cyclesinfos/client?go-get=1 (status code 200)
get "gitlab.com/cyclesinfos/client": found meta tag get.metaImport{Prefix:"gitlab.com/cyclesinfos/client", VCS:"git", RepoRoot:"https://gitlab.com/cyclesinfos/client.git"} at https://gitlab.com/cyclesinfos/client?go-get=1
Fetching https://gitlab.com/cyclesinfos?go-get=1
Parsing meta tags from https://gitlab.com/cyclesinfos?go-get=1 (status code 200)
Fetching https://gitlab.com?go-get=1
Parsing meta tags from https://gitlab.com?go-get=1 (status code 200)
go get gitlab.com/cyclesinfos/client/api: git ls-remote -q https://gitlab.com/cyclesinfos/client.git in /Users/kevin/code/go/pkg/mod/cache/vcs/6d96466a1a9b526be87e300bf1cd68e3e33e0c1e1bc3bed9f76bf5af89f826b8: exit status 128:
	GitLab: The project you were looking for could not be found.
	fatal: Could not read from remote repository.
	
	Please make sure you have the correct access rights
	and the repository exists.

Additionnal information

  • .netrc is correctly configured
  • without go module, go get work fine
  • suffixing url with .git result as an error
go: gitlab.com/cyclesinfos/client/api.git@v1.0.0: parsing go.mod: unexpected module path "gitlab.com/cyclesinfos/client/api"
go: error loading module requirements

go.mod

module gitlab.com/cyclesinfos/producer/watcher

require (
	cloud.google.com/go v0.34.0
	github.com/googleapis/gax-go v2.0.2+incompatible // indirect
	github.com/sirupsen/logrus v1.2.0
	github.com/spf13/viper v1.3.1
	gitlab.com/cyclesinfos/client/api v1.0.0
	gitlab.com/cyclesinfos/provider v1.3.1
	go.opencensus.io v0.18.0 // indirect
	golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
	google.golang.org/api v0.0.0-20181229000844-f26a60c56f14
	google.golang.org/genproto v0.0.0-20181221175505-bd9b4fb69e2f // indirect
	google.golang.org/grpc v1.17.0 // indirect
)
$ go get -v ./...
Fetching https://gitlab.com/cyclesinfos/client/api?go-get=1
Parsing meta tags from https://gitlab.com/cyclesinfos/client/api?go-get=1 (status code 200)
get "gitlab.com/cyclesinfos/client/api": found meta tag get.metaImport{Prefix:"gitlab.com/cyclesinfos/client", VCS:"git", RepoRoot:"https://gitlab.com/cyclesinfos/client.git"} at https://gitlab.com/cyclesinfos/client/api?go-get=1
get "gitlab.com/cyclesinfos/client/api": verifying non-authoritative meta tag
Fetching https://gitlab.com/cyclesinfos/client?go-get=1
Parsing meta tags from https://gitlab.com/cyclesinfos/client?go-get=1 (status code 200)
go: finding gitlab.com/cyclesinfos/client/api v1.0.0
go: gitlab.com/cyclesinfos/client/api@v1.0.0: unknown revision api/v1.0.0
go: error loading module requirements
@katiehockman katiehockman added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 2, 2019
@katiehockman katiehockman added this to the Go1.13 milestone Jan 2, 2019
@katiehockman
Copy link
Contributor

/cc @bcmills

@eraac
Copy link
Author

eraac commented Jan 2, 2019

Probably link to this https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23497 but can't figure why this working correctly without go mod

@bcmills
Copy link
Contributor

bcmills commented Jan 8, 2019

Dup of #29094.

TL;DR: It's a bug in GitLab's <meta name="go-import" […]> tagging. You'll have to take it up with them.

@bcmills bcmills closed this as completed Jan 8, 2019
@golang golang locked and limited conversation to collaborators Jan 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants