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

Russiancold opened this issue Aug 31, 2019 · 0 comments
GoCommand modules NeedsInvestigation


Copy link

@Russiancold Russiancold commented Aug 31, 2019

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

$ go version

Does this issue reproduce with the latest release?


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


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/
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 v1.7.3
go: 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 modules NeedsInvestigation labels Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
GoCommand modules NeedsInvestigation
None yet

No branches or pull requests

2 participants