etcd: go get fails in coreos/etcd with undefined: resolver.BuildOption

Following this example which I upgraded to use go-micro v2. When I run go get -u I get this error:

go: finding gopkg.in/tomb.v1 latest
# github.com/coreos/etcd/clientv3/balancer/picker
../../../../../go3p/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../../../../go3p/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
../../../../../go3p/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../../../../go3p/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption

This looks like an error in coreos/etcd v 3.3.22. Here is my go.mod file:

require (
	github.com/coreos/etcd v3.3.22+incompatible // indirect
	github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
	github.com/fsnotify/fsnotify v1.4.9 // indirect
	github.com/gogo/protobuf v1.3.1 // indirect
	github.com/golang/protobuf v1.4.2
	github.com/imdario/mergo v0.3.9 // indirect
	github.com/micro/go-micro/v2 v2.7.0
	github.com/miekg/dns v1.1.29 // indirect
	github.com/nats-io/nats.go v1.10.0 // indirect
	go.uber.org/zap v1.15.0 // indirect
	golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 // indirect
	golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
	golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect
	golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 // indirect
	golang.org/x/tools v0.0.0-20200521211927-2b542361a4fc // indirect
	google.golang.org/genproto v0.0.0-20200521103424-e9a78aa275b7 // indirect
	google.golang.org/grpc v1.29.1 // indirect
	gopkg.in/yaml.v2 v2.3.0 // indirect
	honnef.co/go/tools v0.0.1-2020.1.4 // indirect
)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 15
  • Comments: 27 (4 by maintainers)

Commits related to this issue

Most upvoted comments

As a workaround locally, I just did go get google.golang.org/grpc@v1.26.0 - that updated the go.mod and builds are working again.

change it to go.etcd.io/etcd/client/v3 instead of go.etcd.io/etcd/clientv3

go clean -modcache resolve my problem

Be careful - grpc >= v1.26.0, <1.27.1 has a nasty bug where temporary failure of DNS resolution will bring your client down until it is restarted. See https://github.com/grpc/grpc-go/issues/3353

Same here:

$ go version
go version go1.14.3 linux/amd64
$ go clean -modcache
$ go get go.etcd.io/etcd/clientv3
go: downloading go.etcd.io/etcd v0.5.0-alpha.5
go: downloading go.etcd.io/etcd v3.3.22+incompatible
go: found go.etcd.io/etcd/clientv3 in go.etcd.io/etcd v3.3.22+incompatible
go: finding module for package google.golang.org/grpc/codes
go: finding module for package google.golang.org/grpc/grpclog
go: finding module for package github.com/coreos/pkg/capnslog
go: finding module for package github.com/coreos/etcd/pkg/logutil
go: finding module for package github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes
go: finding module for package github.com/coreos/etcd/auth/authpb
go: finding module for package google.golang.org/grpc/metadata
go: finding module for package github.com/google/uuid
go: finding module for package github.com/coreos/etcd/mvcc/mvccpb
go: finding module for package google.golang.org/grpc/keepalive
go: downloading github.com/coreos/etcd v0.5.0-alpha.5
go: downloading google.golang.org/grpc v1.29.1
go: downloading github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
go: downloading github.com/google/uuid v1.1.1
go: downloading github.com/coreos/etcd v3.3.22+incompatible
go: finding module for package google.golang.org/grpc/status
go: finding module for package google.golang.org/grpc/credentials
go: finding module for package github.com/coreos/etcd/clientv3/credentials
go: finding module for package github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
go: finding module for package github.com/coreos/etcd/clientv3/balancer/picker
go: finding module for package github.com/coreos/etcd/pkg/types
go: finding module for package github.com/coreos/etcd/clientv3/balancer
go: finding module for package go.uber.org/zap
go: downloading go.uber.org/zap v1.15.0
go: finding module for package github.com/coreos/etcd/version
go: finding module for package google.golang.org/grpc
go: finding module for package github.com/coreos/etcd/etcdserver/etcdserverpb
go: found github.com/coreos/etcd/auth/authpb in github.com/coreos/etcd v3.3.22+incompatible
go: found github.com/coreos/pkg/capnslog in github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
go: found github.com/google/uuid in github.com/google/uuid v1.1.1
go: found go.uber.org/zap in go.uber.org/zap v1.15.0
go: found google.golang.org/grpc in google.golang.org/grpc v1.29.1
go: finding module for package github.com/coreos/go-systemd/journal
go: finding module for package github.com/gogo/protobuf/gogoproto
go: downloading google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
go: downloading golang.org/x/net v0.0.0-20190620200207-3b0461eec859
go: downloading golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: downloading go.uber.org/multierr v1.5.0
go: downloading github.com/golang/protobuf v1.3.3
go: finding module for package github.com/coreos/go-semver/semver
go: downloading github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
go: downloading github.com/gogo/protobuf v1.3.1
go: downloading github.com/coreos/go-semver v0.3.0
go: downloading go.uber.org/atomic v1.6.0
go: downloading golang.org/x/text v0.3.0
go: found github.com/gogo/protobuf/gogoproto in github.com/gogo/protobuf v1.3.1
go: found github.com/coreos/go-systemd/journal in github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
go: found github.com/coreos/go-semver/semver in github.com/coreos/go-semver v0.3.0
# github.com/coreos/etcd/clientv3/balancer/picker
/home/sauterm/golang/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
/home/sauterm/golang/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
/home/sauterm/golang/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
/home/sauterm/golang/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption

go clean -modcache resolve my problem

This did not help. Only go get google.golang.org/grpc@v1.26.0 as mentioned above helps.

As long this bug exists, it is not possible to upgrade grpc.

Dang it. Go starts to remind me a node.js with outdated stuff which just don’t work anymore πŸ€¦β€β™‚οΈ

Any chance this will be fixed? As of May 19th it is still broken.

  newhook mkdir t1
➜  newhook cd t1
➜  t1 go mod init t1
go: creating new go.mod: module t1
➜  t1 go get go.etcd.io/etcd/clientv3    
go: downloading golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974
go: downloading golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f
go: downloading golang.org/x/text v0.3.3
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
../../../../pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../../../pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
# github.com/coreos/etcd/clientv3/balancer/picker
../../../../pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../../../pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions

FWIW the fixes to the short-term problem should be quite simple. A few things were renamed (BuildOption -> BuildOptions, ResolveNowOption -> ResolveNowOptions, PickOptions -> PickInfo), and the signature of Pick was changed slightly from the original API.

GOROOT=D:\go #gosetup GOPATH=D:\go;D:\project #gosetup D:\go\bin\go.exe build -o C:\Users\cph\AppData\Local\Temp\GoLand___go_build_go_micro.exe go-micro #gosetup

github.com/coreos/etcd/clientv3/balancer/resolver/endpoint

D:\go\pkg\mod\github.com\coreos\etcd@v3.3.17+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:114:87: undefined: resolver.BuildOption D:\go\pkg\mod\github.com\coreos\etcd@v3.3.17+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:182:40: undefined: resolver.ResolveNowOption

github.com/coreos/etcd/clientv3/balancer/picker

D:\go\pkg\mod\github.com\coreos\etcd@v3.3.17+incompatible\clientv3\balancer\picker\err.go:37:53: undefined: balancer.PickOptions D:\go\pkg\mod\github.com\coreos\etcd@v3.3.17+incompatible\clientv3\balancer\picker\roundrobin_balanced.go:55:63: undefined: balancer.PickOptions

Compilation finished with exit code 2

Will do. Thanks for helping and thanks for your work.

Please test and provide feedback. The more issues we detect early the higher chances good GA will land in 2-3 weeks.

Faced the same issue. The short term solution by @dfawley of changing the names locally helped. go build now succeeds. go mod tidy still fails with:

github.com/coreos/etcd/clientv3 tested by
        github.com/coreos/etcd/clientv3.test imports
        github.com/coreos/etcd/auth imports
        github.com/coreos/etcd/mvcc/backend imports
        github.com/coreos/bbolt: github.com/coreos/bbolt@v1.3.5: parsing go.mod:
        module declares its path as: go.etcd.io/bbolt
                but was required as: github.com/coreos/bbolt

Tried both go clean -modcache and go get google.golang.org/grpc@v1.26.0.