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 mod falls to download dependencies due to git not using ssh #28653

Closed
lukaskurz opened this issue Nov 8, 2018 · 1 comment
Closed

Comments

@lukaskurz
Copy link

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

$ go version go1.11.2 linux/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="/home/lukas/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/lukas/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build545257636=/tmp/go-build -gno-record-gcc-switches"

What did you do?

export GO111MODULE=on in the project folder
go mod download

The repo I am pulling off is a private one and due to having 2FA i can only properly pull using ssh, not https.

What did you expect to see?

I expected it to work and download all dependencies. Apparently git failed pulling, but does not log that into the output.

What did you see instead?

$ go: finding gitlab.com/mygroup/myfolder v0.0.1
$ gitlab.com/mygroup/myfolder v0.0.1 unknown revision

$ go: error loading module requirements

How did you fix it

After pulling the problematic repo manually, I noticed that git failed pulling, so I added one of the git hacks, where it changes https://gitlab.com to git@gitlab.com. This seemed to have fixed the problem. I think go mod should have a more verbose output, or a verbose option where it logs, that git is failing to pull.

@agnivade
Copy link
Contributor

agnivade commented Nov 8, 2018

Duplicate of #27088. Please feel free to subscribe to the issue. Thank you.

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