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: get not using GOPROXY and bypassing operation to git #39835

Closed
VladimirDe opened this issue Jun 24, 2020 · 5 comments
Closed

cmd/go: get not using GOPROXY and bypassing operation to git #39835

VladimirDe opened this issue Jun 24, 2020 · 5 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@VladimirDe
Copy link

VladimirDe commented Jun 24, 2020

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

$ go version
go version go1.14.4 windows/386

Does this issue reproduce with the latest release?

yes

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

go env
go1.14.4 env
set GO111MODULE=on
set GOARCH=386
set GOBIN=
set GOCACHE=C:\Users\Vladimir\AppData\Local\go-build
set GOENV=C:\Users\Vladimir\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=386
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=*
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Vladimir\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org
set GOROOT=C:\Users\Vladimir\sdk\go1.14.4
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\Vladimir\sdk\go1.14.4\pkg\tool\windows_386
set GCCGO=gccgo
set GO386=sse2
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\Vladimir\go\gpb\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=-m32 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Vladimir\AppData\Local\Temp\go-build933846070=/tmp/go-build -gno-record-gcc-switches

What did you do?

on not accesibly github.com (could be emulated by adding 0.0.0.0 github.com into c:\windows\system32\drivers\etc\hosts on windows host or into /etc/hosts on unix one) go get not using GOPROXY and trying to get it directly (bypassing this operation to git)

C:\Users\Vladimir>go get -v github.com/golang/example/hello
go get github.com/golang/example/hello: module github.com/golang/example/hello: git ls-remote -q origin in C:\Users\Vladimir\go\pkg\mod\cache\vcs\3eb23b64ac0258a2f08ebd7b6cbc18375720f6f168ee29ad8527f1a84cf52120: exit status 128:
        fatal: unable to access 'https://github.com/golang/example/': Could not resolve host: github.com

What did you expect to see?

go get -v -u github.com/gorilla/websocket
Fetching https://proxy.golang.org/github.com/gorilla/websocket/@v/list

What did you see instead?

fatal: unable to access 'https://github.com/golang/example/': Could not resolve host: github.com
@heschi
Copy link
Contributor

heschi commented Jun 24, 2020

Please rerun the command with -x to see the exact flow of requests.

@VladimirDe
Copy link
Author

C:\Users\Vladimir\go\gpb>go1.14.4 get -x github.com/golang/example/hello
# get https://github.com/?go-get=1
mkdir -p C:\Users\Vladimir\go\pkg\mod\cache\vcs # git3 https://github.com/golang/example
# lock C:\Users\Vladimir\go\pkg\mod\cache\vcs\3eb23b64ac0258a2f08ebd7b6cbc18375720f6f168ee29ad8527f1a84cf52120.lock# C:\Users\Vladimir\go\pkg\mod\cache\vcs\3eb23b64ac0258a2f08ebd7b6cbc18375720f6f168ee29ad8527f1a84cf52120 for git3 https://github.com/golang/example
cd C:\Users\Vladimir\go\pkg\mod\cache\vcs\3eb23b64ac0258a2f08ebd7b6cbc18375720f6f168ee29ad8527f1a84cf52120; git ls-remote -q origin
# get https://github.com/?go-get=1: Get "https://github.com/?go-get=1": dial tcp: lookup github.com: getaddrinfow: The requested name is valid, but no data of the requested type was found.
0.098s # cd C:\Users\Vladimir\go\pkg\mod\cache\vcs\3eb23b64ac0258a2f08ebd7b6cbc18375720f6f168ee29ad8527f1a84cf52120; git ls-remote -q origin
# get https://github.com/golang/example
# get https://github.com/golang/example: Get "https://github.com/golang/example": dial tcp: lookup github.com: getaddrinfow: The requested name is valid, but no data of the requested type was found.
go get github.com/golang/example/hello: module github.com/golang/example/hello: git ls-remote -q origin in C:\Users\Vladimir\go\pkg\mod\cache\vcs\3eb23b64ac0258a2f08ebd7b6cbc18375720f6f168ee29ad8527f1a84cf52120: exit status 128:
        fatal: unable to access 'https://github.com/golang/example/': Could not resolve host: github.com

@cagedmantis cagedmantis changed the title go get not using GOPROXY and bypassing operation to git cmd/go: get not using GOPROXY and bypassing operation to git Jun 25, 2020
@cagedmantis cagedmantis added this to the Backlog milestone Jun 25, 2020
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 25, 2020
@cagedmantis
Copy link
Contributor

/cc @bcmills @jayconrod @matloob

@bcmills
Copy link
Contributor

bcmills commented Jun 25, 2020

The answer is in your go env output:

set GONOPROXY=*

You have somehow set GONOPROXY to match all module paths — perhaps in your process environment, or perhaps via go env -w. If the latter, go env -u GONOPROXY should fix it.

@bcmills bcmills added modules WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jun 25, 2020
@VladimirDe
Copy link
Author

Thanks, it did help. Need to have the following keys in environment:

>go1.14.4 env
set GO111MODULE=on
set GONOPROXY=
set GOPROXY=https://proxy.golang.org

I close issue

@golang golang locked and limited conversation to collaborators Jun 26, 2021
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants