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: import fails with subgroups #44054

Closed
jbohanon opened this issue Feb 1, 2021 · 4 comments
Closed

cmd/go: import fails with subgroups #44054

jbohanon opened this issue Feb 1, 2021 · 4 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@jbohanon
Copy link

jbohanon commented Feb 1, 2021

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

$ go version
go version go1.15.7 windows/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
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\me\AppData\Local\go-build
set GOENV=C:\Users\me\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\me\AppData\Local\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\me\AppData\Local\go
set GOPRIVATE=https://git.mycompany.com
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\me\AppData\Local\go\go1.15.7
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\me\AppData\Local\go\go1.15.7\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\me\Documents\Code\me\_go\gologger\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\me\AppData\Local\Temp\go-build675008778=/tmp/go-build -gno-record-gcc-switches

What did you do?

Using a private GitLab server with subgroups, the go get command fails to find the appropriate root of the repository and attempts to download, giving exit status 128

What did you expect to see?

I expected it to download the module

What did you see instead?

go get -u -v
go: finding module for package git.mycompany.com/utilities/go/message-brokering/mqtt
get "git.mycompany.com/utilities/go": found meta tag get.metaImport{Prefix:"git.mycompany.com/utilities/go", VCS:"git", RepoRoot:"https://git.mycompany.com/utilities/go.git"} at //git.mycompany.com/utilities/go?go-get=1
get "git.mycompany.com/utilities/go/message-brokering": found meta tag get.metaImport{Prefix:"git.mycompany.com/utilities/go", VCS:"git", RepoRoot:"https://git.mycompany.com/utilities/go.git"} at //git.mycompany.com/utilities/go/message-brokering?go-get=1
get "git.mycompany.com/utilities/go/message-brokering/mqtt": found meta tag get.metaImport{Prefix:"git.mycompany.com/utilities/go", VCS:"git", RepoRoot:"https://git.mycompany.com/utilities/go.git"} at //git.mycompany.com/utilities/go/message-brokering/mqtt?go-get=1
get "git.mycompany.com/utilities/go/message-brokering/mqtt": verifying non-authoritative meta tag
get "git.mycompany.com/utilities/go/message-brokering": verifying non-authoritative meta tag
go: finding module for package git.mycompany.com/utilities/go/message-brokering/mqtt
gologger.go:8:2: module git.mycompany.com/utilities/go/message-brokering/mqtt: git ls-remote -q origin in 
C:\Users\me\AppData\Local\go\pkg\mod\cache\vcs\05a6835aeda72f1a69ded8a71bbefb98908e5c080bafc868a0a1ff204278f2f5: exit 
status 128:
        fatal: repository 'https://git.mycompany.com/utilities/go.git/' not found

Worth noting that I found a thread that appeared to show this issue as resolved (#34094), but I am definitely still experiencing this. I even tried rolling back to 1.13.8 and it was still present. Also of note, I began on gitlab-ee 12.9.2, upgraded to gitlab-ee 13.8.1.

@seankhliao
Copy link
Member

Is utilities a group, utilities/go a subgroup and utilities/go/message-brokering a repo?

Has this worked before for you?

Have tried setting a netrc with credentials to allow go to make authenticated http requests to gitlab?

@seankhliao seankhliao changed the title Go Get fails due to go-import metatags cmd/go: import fails with subgroups Feb 1, 2021
@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 1, 2021
@jbohanon
Copy link
Author

jbohanon commented Feb 1, 2021

utilities is a group, utilities/go a subgroup, and utilities/go/message-brokering is a subgroup. utilities/go/message-brokering/mqtt is a repo. I have not tried using netrc, but I've never had auth issues. git.mycompany.com/user/project and git.mycompany.com/group/project have both always worked.

edit: I'm authenticated via Windows Credential Manager.

@seankhliao
Copy link
Member

seankhliao commented Feb 1, 2021

please try a netrc and this sounds more like a gitlab issue than a go one (see https://gitlab.com/gitlab-org/gitlab/-/issues/5253)

@jbohanon
Copy link
Author

jbohanon commented Feb 1, 2021

Indeed seemed to be a gitlab issue. Also of note Windows requires a _netrc instead of .netrc. That had me chasing my tail.

@jbohanon jbohanon closed this as completed Feb 1, 2021
@golang golang locked and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants