Etcd: go module install etcd go.etcd.io/etcd/clientv3 will install a version from the wrong repo

Created on 12 Jan 2019  Â·  8Comments  Â·  Source: etcd-io/etcd

go module install etcd go.etcd.io/etcd/clientv3 will install a version from the wrong repo:

My mod file says:
go.etcd.io/etcd v3.3.11+incompatible

but when I go to the vendor directory, all of the files have references to the coreos repo.

aretooling stale

Most helpful comment

cannot use s.client (type *"go.etcd.io/etcd/clientv3".Client) as type *"github.com/coreos/etcd/clientv3".Client in argument to concurrency.NewSession

same issue, such a big mess!

All 8 comments

Assuming that you do not want to break existing users of v3.3.11 and below, a proper fix will probably require that you bump the major version to v4 and change the corresponding module and import paths to go.etcd.io/etcd/v4.

I am experiencing the same problem。

I get an error while building code:
undefined: clientv3.WithFragment

image

cc @jpbetz

I experience a similar problem with Go 1.12, where I get following error during compilation when using the go.etcd.io/etcd/clientv3 package:

# github.com/tus/tusd/etcd3locker
etcd3locker/locker.go:140:38: cannot use locker.Client (type *"go.etcd.io/etcd/clientv3".Client) as type *"github.com/coreos/etcd/clientv3".Client in argument to concurrency.NewSession

(Available at https://github.com/tus/tusd/blob/master/etcd3locker/locker.go#L140)

I am not entirely sure if it's related but this issue only started appearing after I activated the Go module support. Are there any known workarounds?

@Acconut for now your going to need to use github.com/coreos/etcd as a dep revendor and import accordingly. 3.3.x is still in the old org. We will move to go.etcd.io in 3.4

@hexfusion Thank you very much, I wasn't aware that this version is not yet released. Using github.com/coreos/etcd fixed my issues.

cannot use s.client (type *"go.etcd.io/etcd/clientv3".Client) as type *"github.com/coreos/etcd/clientv3".Client in argument to concurrency.NewSession

same issue, such a big mess!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings