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: confusing error message when downloading modules with no internet connection #33995

Closed
Russiancold opened this issue Aug 31, 2019 · 1 comment
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Russiancold
Copy link

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

$ go version
1.12.9

Does this issue reproduce with the latest release?

Yes

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

go env GOOS=linux GOARCH=amd64
$ go env

What did you do?

I've tried to build my go app with modules in docker.

FROM golang:1.12.9 as builder

ENV GO111MODULE=on
WORKDIR /app

COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o encashment


FROM scratch
COPY --from=builder /app/encashment /encashment/
EXPOSE 8080
ENTRYPOINT ["/app/encashment"]

The problem was that my docker had no internet connection and go mod download couldn't load packages. I was very confused with an error message it returns. Suddenly, I don't know exactly what was wrong and how to reproduce this properly. But I did:

pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
docker -d

And this worked for me.

What did you expect to see?

Error message informing that something is wrong with internet connection.

What did you see instead?

go: finding github.com/gorilla/mux v1.7.3
go: github.com/gorilla/mux@v1.7.3: unknown revision v1.7.3
go: error loading module requirements
@smasher164 smasher164 changed the title Confusing error message from go mod in case of no internet connection. cmd/go: confusing error message when downloading modules with no internet connection Aug 31, 2019
@smasher164 smasher164 added GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 31, 2019
@seankhliao seankhliao added this to the Unplanned milestone Aug 27, 2022
@seankhliao
Copy link
Member

Current error message seems reasonable.

$ go mod download
go: github.com/gorilla/mux@v1.8.0: Get "https://proxy.golang.org/github.com/gorilla/mux/@v/v1.8.0.mod": dial tcp: lookup proxy.golang.org: i/o timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants