etcd-io / etcd

Distributed reliable key-value store for the most critical data of a distributed system
https://etcd.io
Apache License 2.0
47.64k stars 9.75k forks source link

clientv3: grpc-go (v1.27.0) made API changes to balancer / resolver. #11563

Closed eddycjy closed 4 years ago

eddycjy commented 4 years ago

After the release of grpc-go v1.27.0, an error occurred while pulling etcd / clientv3. The steps to reproduce it are as follows:

  1. go.mod:
go 1.13

require (
    github.com/coreos/etcd v3.3.18+incompatible // indirect
    github.com/coreos/go-systemd v0.0.0-00010101000000-000000000000 // indirect
    github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
    github.com/gogo/protobuf v1.3.1 // indirect
    github.com/google/uuid v1.1.1 // indirect
    go.etcd.io/etcd v3.3.18+incompatible // indirect
    go.uber.org/zap v1.13.0 // indirect
    google.golang.org/grpc v1.27.0 // indirect
)

replace github.com/coreos/go-systemd => github.com/coreos/go-systemd/v22 v22.0.0
  1. command:
$ go get go.etcd.io/etcd/clientv3
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
../../go/pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../go/pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
# github.com/coreos/etcd/clientv3/balancer/picker
../../go/pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../go/pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
  1. PR:https://github.com/etcd-io/etcd/pull/11564
blueridgemountains1 commented 3 years ago

Why is this closed? I'm still having this issue and it looks like several others are as well.

yes, still an issue. Please fix, thanks

Ayanrocks commented 3 years ago

replace ( google.golang.org/grpc => google.golang.org/grpc v1.27.0 github.com/coreos/etcd => github.com/ozonru/etcd v3.3.20-grpc1.27-origmodule+incompatible )

This seems to be the only workaround even in 2021. This needs to be fixed as a lot of packages is dependent on it. Apparently it's a wide known bug

pan2za commented 3 years ago

github.com/coreos/etcd/clientv3/balancer/resolver/endpoint ../../../pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption ../../../pkg/mod/github.com/coreos/etcd@v3.3.18+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.18+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions ../../../pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions

above given issue is solved after downgrading the etcd version mentioned below github.com/coreos/etcd v3.3.18+incompatible => github.com/coreos/etcd v3.3.4+incompatible

This solved my issue

aka-achu commented 3 years ago
replace (
    github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.5
    google.golang.org/grpc => google.golang.org/grpc v1.26.0
)

require (
    github.com/coreos/bbolt v0.0.0-00010101000000-000000000000 // indirect
    github.com/coreos/etcd v3.3.25+incompatible // indirect
    github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
    github.com/go-playground/validator/v10 v10.5.0
    github.com/google/btree v1.0.1 // indirect
    github.com/google/uuid v1.2.0
    github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
    github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
    github.com/jonboulle/clockwork v0.2.2 // indirect
    github.com/prometheus/client_golang v1.10.0 // indirect
    github.com/soheilhy/cmux v0.1.5 // indirect
    github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
    go.etcd.io/etcd v3.3.25+incompatible
    go.uber.org/zap v1.16.0 // indirect
    golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
)

This is working for me.

BoyChai commented 3 months ago

Can it only be solved by downgrading the grpc version ? https://github.com/etcd-io/etcd/issues/18344