Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile client using Go modules #12009

Closed
nnathan opened this issue Jun 14, 2020 · 7 comments
Closed

Cannot compile client using Go modules #12009

nnathan opened this issue Jun 14, 2020 · 7 comments
Labels

Comments

@nnathan
Copy link

nnathan commented Jun 14, 2020

I'm trying to write a program using the clientv3 client.

package main

import (
	"fmt"
	"time"

	"github.com/coreos/etcd/clientv3"
)

func main() {
	baseconfig := clientv3.Config{
		Endpoints:            []string{"http://127.0.0.1:2379"},
		DialTimeout:          2 * time.Second,
		DialKeepAliveTime:    2 * time.Second,
		DialKeepAliveTimeout: 6 * time.Second,
	}

	client, err := clientv3.New(baseconfig)

	if err != nil {
		fmt.Printf("error creating client: %v", err)
	}

	_ = client
}

I'm also using Go modules. When I try to build the example program:

$ go build
go: finding module for package github.com/coreos/etcd/clientv3
go: downloading github.com/coreos/etcd v0.5.0-alpha.5
go: found github.com/coreos/etcd/clientv3 in github.com/coreos/etcd v3.3.22+incompatible
go: finding module for package google.golang.org/grpc/keepalive
go: finding module for package github.com/google/uuid
go: finding module for package github.com/golang/protobuf/proto
go: finding module for package google.golang.org/grpc/credentials
go: finding module for package github.com/coreos/pkg/capnslog
go: finding module for package google.golang.org/grpc
go: finding module for package google.golang.org/grpc/grpclog
go: finding module for package go.uber.org/zap
go: finding module for package google.golang.org/grpc/metadata
go: finding module for package google.golang.org/grpc/resolver
go: finding module for package go.uber.org/zap/zapcore
go: finding module for package github.com/gogo/protobuf/gogoproto
go: finding module for package github.com/coreos/go-semver/semver
go: finding module for package google.golang.org/genproto/googleapis/api/annotations
go: finding module for package github.com/coreos/go-systemd/journal
go: finding module for package google.golang.org/grpc/balancer
go: finding module for package google.golang.org/grpc/resolver/dns
go: downloading google.golang.org/genproto v0.0.0-20200612171551-7676ae05be11
go: finding module for package google.golang.org/grpc/status
go: finding module for package google.golang.org/grpc/codes
go: finding module for package google.golang.org/grpc/resolver/passthrough
go: finding module for package google.golang.org/grpc/connectivity
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: found github.com/gogo/protobuf/gogoproto in github.com/gogo/protobuf v1.3.1
go: found github.com/golang/protobuf/proto in github.com/golang/protobuf v1.4.2
go: found google.golang.org/genproto/googleapis/api/annotations in google.golang.org/genproto v0.0.0-20200612171551-7676ae05be11
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
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../go/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
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption

Maybe I shouldn't be building off the latest tree, but I don't know how to dial back to a stable version of etcd using go modules either. Any help would be appreciated.

@santoshkowshikhr
Copy link

santoshkowshikhr commented Jun 14, 2020

I am having the same issue as well, tried manually cloning 3.4 version ran into same error.

@tennessine
Copy link

Is this project dead?
It's so hard to use, even write a simple hello world example.
Why?

@nnathan
Copy link
Author

nnathan commented Jun 15, 2020

@tennessine It seems to be impossible to contact with anyone that works on etcd.

@limingyao
Copy link

google.golang.org/grpc v1.26.0

@cfc4n
Copy link
Contributor

cfc4n commented Jun 15, 2020

@gyuho go mod will get lastest version package default. GRPC-GO's lastest version was 1.29.1 at https://pkg.go.dev/google.golang.org/grpc?tab=doc . Do you have some ideas about this bug?
add a go.mod file to git repository?

ref. #11931

/cc @gyuho @mitake @spzala

@cfc4n
Copy link
Contributor

cfc4n commented Jun 17, 2020

@nnathan or use this shell

$ go mod edit -replace=google.golang.org/grpc=google.golang.org/grpc@v1.23.0
$ make

@stale
Copy link

stale bot commented Sep 15, 2020

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

@stale stale bot added the stale label Sep 15, 2020
@stale stale bot closed this as completed Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants