go: cmd/go: retry failed fetches
$ go version
go version go1.11.1 darwin/amd64
package main
import (
_ "github.com/google/go-cloud/wire/cmd/wire"
)
func main() {
//
}
go build -o a.out
go: finding github.com/google/go-cloud/wire/cmd/wire latest
go: finding github.com/google/go-cloud/wire/cmd latest
go: finding github.com/google/go-cloud/wire latest
go: finding google.golang.org/api v0.0.0-20180606215403-8e9de5a6de6d
go: google.golang.org/api@v0.0.0-20180606215403-8e9de5a6de6d: git fetch -f https://code.googlesource.com/google-api-go-client refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/chai/go/pkg/mod/cache/vcs/9e62a95b0409d58bc0130bae299bdffbc7b7e74f3abe1ecf897474cc474b8bc0: exit status 128:
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
go: error loading module requirements
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 16
- Comments: 22 (10 by maintainers)
Commits related to this issue
- Retries failed go get requests. Temporary solution until https://github.com/golang/go/issues/28194 is fixed in order to retry failed fetch requests. — committed to ser-io/android-cuttlefish by ser-io a year ago
- Retries failed go get requests. Temporary solution until https://github.com/golang/go/issues/28194 is fixed in order to retry failed fetch requests. — committed to ser-io/android-cuttlefish by ser-io a year ago
- Retries failed go get requests. Temporary solution until https://github.com/golang/go/issues/28194 is fixed in order to retry failed fetch requests. — committed to ser-io/android-cuttlefish by ser-io a year ago
- Retries failed go get requests. (#229) Temporary solution until https://github.com/golang/go/issues/28194 is fixed in order to retry failed fetch requests. — committed to google/android-cuttlefish by ser-io a year ago
for me it was a kind of same problem; using
GOPROXY=https://proxy.golang.org
fixed it@thempatel Thanks for the idea.
I created this script that uses as a base go mod download to download the dependency and if it fails try again.
The script tries to download the dependency 5 times with an interval of 20 seconds.
@eduardo-mior similar to @linzhp we at FullStory also use a module cache directory that we pre-populate in our CI jobs. You can build a retry loop in your flavor of shell (e.g. https://unix.stackexchange.com/a/82610) and wrap
go mod download
inside of it. For us, the process of archiving and inflating all of our dependencies is slower than simply re-downloading them all so we prefer that route but could be a good avenue for you.@mvdan Is there any solutions, such as copy the git repository directly to the mod directory? I always get this problem,under $GOPATH I can download the zip file from git then do some other work to solve it, but with
go mod
I have no idea. Thanks~