go: cmd/go: module fetch errors are unclear

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

go version devel +5f5402b Tue Jul 24 23:54:08 2018 +0000 linux/amd64

What did you do?

go mod init -module example.com/mod
go get github.com/google/go-cloud

This produced the following output:

go: finding github.com/google/go-cloud v0.1.0
go: finding github.com/tidwall/gjson v1.1.2
go: finding github.com/aws/aws-xray-sdk-go v1.0.0-rc.5
go: finding github.com/fsnotify/fsnotify v1.4.7
go: finding github.com/gorilla/context v1.1.1
go: finding github.com/dnaeon/go-vcr v0.0.0-20180504081357-f8a7e8b9c630
go: finding github.com/aws/aws-sdk-go v1.13.20
go: finding go.opencensus.io v0.12.0
go: finding google.golang.org/grpc v1.13.0
go: finding contrib.go.opencensus.io/exporter/stackdriver v0.0.0-20180421005815-665cf5131b71
go: finding cloud.google.com/go v0.25.0
go: finding github.com/tidwall/sjson v1.0.0
go: finding github.com/smartystreets/assertions v0.0.0-20180301161246-7678a5452ebe
go: finding github.com/googleapis/gax-go v1.0.0
go: finding golang.org/x/sys v0.0.0-20180329131831-378d26f46672
go: finding github.com/gopherjs/gopherjs v0.0.0-20180424202546-8dffc02ea1cb
go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding golang.org/x/text v0.3.0
go: finding golang.org/x/net v0.0.0-20180702212446-ed29d75add3d
go: finding gopkg.in/ini.v1 v1.37.0
go: finding github.com/go-ini/ini v1.37.0
go: finding github.com/golang/protobuf v1.1.0
go: finding github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
go: finding github.com/census-ecosystem/opencensus-go-exporter-aws v0.0.0-20180411051634-41633bc1ff6b
go: finding golang.org/x/tools v0.0.0-20180314180217-d853e8088c62
go: finding github.com/go-sql-driver/mysql v0.0.0-20180308100310-1a676ac6e4dc
go: finding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: github.com/jmespath/go-jmespath@v0.0.0-20180206201540-c2b33e8439af: git fetch -f --depth=1 origin c2b33e8439af944379acbdd9c3a5fe0bc44bd8a5:refs/dummy in /home/rog/src/go/src/mod/cache/vcs/7b1106ecb177564b0bc9784f963c6c785e31d09dcd9f08114684d32af620443f: exit status 1
go: finding golang.org/x/oauth2 v0.0.0-20180603041954-1e0a3fa8ba9a
go: github.com/census-ecosystem/opencensus-go-exporter-aws@v0.0.0-20180411051634-41633bc1ff6b: git fetch -f --depth=1 origin 41633bc1ff6bd23f2beb03aafb533465f3e774d8:refs/dummy in /home/rog/src/go/src/mod/cache/vcs/28c9bbc7175856813846e87fcbc6da1a390ca3679ea2b8f3e8aa0698f2334be7: exit status 1
go: finding github.com/jtolds/gls v0.0.0-20170503224851-77f18212c9c7
go: finding gopkg.in/yaml.v2 v2.2.1
go: github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b: git fetch -f --depth=1 origin 23def4e6c14b4da8ac2ed8007337bc5eb5007998:refs/dummy in /home/rog/src/go/src/mod/cache/vcs/0dac7c3b21e56acaa4cfab3e2c4d83e362d33743d1e198c0d546115da37bae02: exit status 1
go: finding github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd
go: finding google.golang.org/genproto v0.0.0-20180627194029-ff3583edef7d
go: finding github.com/stretchr/testify v1.2.1
go: finding google.golang.org/api v0.0.0-20180606215403-8e9de5a6de6d
go: github.com/smartystreets/gunit@v0.0.0-20180314194857-6f0d6275bdcd: git fetch -f --depth=1 origin 6f0d6275bdcdd4411ad1c9b3b69eda55eea5b2db:refs/dummy in /home/rog/src/go/src/mod/cache/vcs/8b17522217382c37f84409229f7711408129a6c273254893129c5df1940e85cc: exit status 1
go: finding github.com/gorilla/mux v1.6.1
go: finding github.com/tidwall/match v0.0.0-20171002075945-1731857f09b1
go: github.com/tidwall/match@v0.0.0-20171002075945-1731857f09b1: git fetch -f --depth=1 https://github.com/tidwall/match 1731857f09b1f38450e2c12409748407822dc6be:refs/dummy in /home/rog/src/go/src/mod/cache/vcs/94ba56ba5b973670f7952b0a5b76feea7af42eb6e1f973fdb61999862b84c7a7: exit status 1
go: finding google.golang.org/appengine v1.1.0
go: finding github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a
go: finding github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20180321230639-1e456b1c68cb
go: github.com/smartystreets/goconvey@v0.0.0-20180222194500-ef6db91d284a: git fetch -f --depth=1 origin ef6db91d284a0e7badaa1f0c404c30aa7dee3aed:refs/dummy in /home/rog/src/go/src/mod/cache/vcs/1693d9c59c0c1838de53cecb8601eec3084f084265b72c82e78de941f1c8f58c: exit status 1

go: error loading module requirements

It’s clear that some of the git fetch commands failed, but because all the actual error output is discarded, it’s not possible to see why. “exit status 1” doesn’t convey any significantly useful info, so it’s hard to know what went wrong and hence how the problem might be resolved.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I could move off git 2.7.4 but as it’s the default version you get when using Ubuntu 16.04 I think it’s important that Go works correctly with that version.

Sorry, another message in this thread

I’m seeing the aforementioned behaviour on CircleCI v2 (which has git 2.11.0), so not an uncommon setup people will be using. CircleCI globally sets url.ssh://git@github.com.insteadof=https://github.com, hence how this comes about.

This issue #26594 is slightly complicated by the fact that apparently here outputting errors from git would not have helped here (because here git was silent), but it seems outputting errors from git would have helped other issues, e.g., see https://github.com/golang/go/issues/26594#issuecomment-407797257