Skip to content

Problem using go mod download / go get with https git override #63765

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
nlacey opened this issue Oct 27, 2023 · 2 comments
Closed

Problem using go mod download / go get with https git override #63765

nlacey opened this issue Oct 27, 2023 · 2 comments

Comments

@nlacey
Copy link

nlacey commented Oct 27, 2023

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

go version go1.21.3 linux/amd64
git version 2.42.0

Does this issue reproduce with the latest release?

Yes

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

go env GO111MODULE='on' GOARCH='amd64' GOBIN='' GOCACHE='/home/{user}/.cache/go-build' GOENV='/home/{user}/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/{user}/gocode/pkg/mod' GONOPROXY='github.com/{company}' GONOSUMDB='github.com/{company}' GOOS='linux' GOPATH='/home/{user}/gocode' GOPRIVATE='github.com/{company}' GOPROXY='https://proxy.golang.org,direct' GOROOT='/usr/local/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.21.3' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' CGO_ENABLED='1' GOMOD='/home/{user}/gocode/src/github.com/{company}/{project}/go.mod' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1956803038=/tmp/go-build -gno-record-gcc-switches'
$ go env

What did you do?

What did you expect to see?

I'd expect the same behavior as running the command manually
git ls-remote -q origin in /home/{user}/gocode/pkg/mod/cache/vcs/{hash}
Username for 'https://github.com': {github user}
Password for 'https://{github user}@github.com': {Github PAT Personal Access Token}

What did you see instead?

go: github.com/{company}/{project}/[email protected]: reading github.com/{company}/{project}/go.mod at revision v3.15.0: git ls-remote -q origin in /home/{user}/gocode/pkg/mod/cache/vcs/{hash}: exit status 128:
ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I see similar errors from git when I don't have the over-rides in place

[url "https://"]
insteadOf = ssh://
[url "https://github.com/"]
insteadOf = [email protected]:

Because my network only allows https access to github

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
@nlacey
Copy link
Author

nlacey commented Oct 30, 2023

On a Linux system, I fixed issues by creating a ~/.netrc file and add line
machine github.com login {github user} password {github personal access token}

Which made git stop asking for command line input

@golang golang locked and limited conversation to collaborators Oct 29, 2024
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