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

Go modules issue with gitlab groups and sub-groups #34469

Closed
UltraNemesis opened this issue Sep 23, 2019 · 2 comments
Closed

Go modules issue with gitlab groups and sub-groups #34469

UltraNemesis opened this issue Sep 23, 2019 · 2 comments

Comments

@UltraNemesis
Copy link

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

$ go version
go version go1.13 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=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\user\AppData\Local\go-build
set GOENV=C:\Users\user\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=git.mygitlab.com
set GONOSUMDB=git.mygitlab.com
set GOOS=windows
set GOPATH=C:\Users\user\go
set GOPRIVATE=git.mygitlab.com
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
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 -fmessage-length=0 -fdebug-prefix-map=C:\Users\user\AppData\Local\Temp\go-build077520534=/tmp/go-build -gno-record-gcc-switches

What did you do?

Trying to initialize and tidy a go module on a path with gitlab groups. The gitlabs is a private instance and GOPRIVATE has been set accordingly

Steps

Step 1: Create a package inside a nested sub group. This has no additional dependencies

go mod init git.mygitlab.com/group/subgroup1/subgroup2/mypackage1
go: creating new go.mod: module git.mygitlab.com/group/subgroup1/subgroup2/mypackage1

Step 2: Create another package inside the nested sub group. This has the first package as dependency.

go mod init git.mygitlab.com/group/subgroup1/subgroup2/mypackage2
go: creating new go.mod: module git.mygitlab.com/group/subgroup1/subgroup2/mypackage2

Step 3: Run go mod tidy or even go get

go mod tidy -v

get "git.mygitlab.com/group/subgroup1/subgroup2": found meta tag get.metaImport{Prefix:"git.mygitlab.com/group/subgroup1", VCS:"git", RepoRoot:"https://git.mygitlab.com/group/subgroup1.git"} at //git.mygitlab.com/group/subgroup1/subgroup2?go-get=1
get "git.mygitlab.com/group/subgroup1/subgroup2": verifying non-authoritative meta tag
get "git.mygitlab.com/group/subgroup1/subgroup2/mypackage1": found meta tag get.metaImport{Prefix:"git.mygitlab.com/group/subgroup1/subgroup2/mypackage1", VCS:"git", RepoRoot:"https://git.mygitlab.com/group/subgroup1/subgroup2/mypackage1.git"} at //git.mygitlab.com/group/subgroup1/subgroup2/mypackage1?go-get=1
get "git.mygitlab.com/group/subgroup1": found meta tag get.metaImport{Prefix:"git.mygitlab.com/group/subgroup1", VCS:"git", RepoRoot:"https://git.mygitlab.com/group/subgroup1.git"} at //git.mygitlab.com/group/subgroup1?go-get=1
go: finding git.mygitlab.com/group/subgroup1/subgroup2/mypackage1 latest
git.mygitlab.com/group/subgroup1/subgroup2/mypackage2 imports
        git.mygitlab.com/group/subgroup1/subgroup2/mypackage1: git ls-remote -q https://git.mygitlab.com/group/subgroup1.git in C:\Users\user\go\pkg\mod\cache\vcs\0b72d9151ce56c3b8377f8a4a8f350e5adbbfecf9e05aa65328195684ab0ce6e: exit status 128:
        remote: The project you were looking for could not be found.
        fatal: repository 'https://git.mygitlab.com/group/subgroup1.git/' not found

What did you expect to see?

No errors and "go mod tidy" or "go get" completes successfully

What did you see instead?

Errors thrown despite the entire project being made public visible (no authentication required). I understand the previous problems with gitlab groups and go get. That is not applicable here since I have made the project path public and even meta data comes out properly when the full path is hit like this.

https://git.mygitlab.com/group/subgroup1/subgroup2/mypackage1?go-get=1

<html><head><meta name="go-import" content="git.mygitlab.com/group/subgroup1/subgroup2/mypackage1 git https://git.mygitlab.com/group/subgroup1/subgroup2/mypackage1.git" /></head></html>

Note that go get also works fine without modules using the GOPATH. So, this problem is coming only when using go modules.

@agnivade
Copy link
Contributor

Duplicate of #34094 ?

@UltraNemesis
Copy link
Author

Yes, looks like a duplicate of #34094

@golang golang locked and limited conversation to collaborators Sep 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants