Grpc-go: undefined: grpc.SupportPackageIsVersion3

Created on 28 Nov 2016  Â·  26Comments  Â·  Source: grpc/grpc-go

The following commit:

commit 727a60e4d135c53c4d62d708ac4528f7c077c0d0
Author: Mak Mukhi <[email protected]>
Date:   Fri Oct 21 18:06:55 2016 -0700

    update server reflection code to comply with the change to the grpc generator

Introduces the error:

# github.com/org/repo/vendor/some_grpc_lib
vendor/some_grpc_lib/some_lib.pb.go:173: undefined: grpc.SupportPackageIsVersion3`

The error message is not helpful. I have tried regenerating source files using the latest protoc

$ protoc --version
libprotoc 3.1.0

How can this problem be fixed?
Can you provide a more helpful error message?

Most helpful comment

We are having a nightmare of a time dealing with this issue also.

How do you recommend working through it?

Here's an example. We have a developer working on project A who generates their gRPC code with grpc.SupportPackageIsVersion3.

A developer working on project B imports the package with the generated gRPC client from project A. Project B also needs to generate a gRPC server but they generate it with grpc.SupportPackageIsVersion4.

Now the project cannot build.

So you suggest re-generating the protofile from Project A, but this feels weird to us. Now we're changing a vendored file (the generated file) that really should be untouchable since it belongs to Project A.

Also, a lot of our files are difficult to generate in the vendored folder since they rely on imports that are relative to Project's A repo.

Another alternative is to copy/paste the code in the .proto file from Project A to Project B and have Project B generate its own client code. We're duplicating that code and separating it though, so this seems less than ideal as well.

What do you suggest? This really is a huge problem for us and I don't feel like there's a great solution. If you have a single gRPC dependency you are importing then it might be fairly straight-forward, but when you have several that each have several dependencies of their own it becomes a huge pain.

All 26 comments

Please make sure proto package, gRPC package are all up to date.
https://github.com/grpc/grpc-go#compiling-error-undefined-grpcsupportpackageisversion

github.com/golang/protobuf/{proto,protoc-gen-go}

proto$ cd $GOPATH/src/github.com/golang/protobuf/proto
proto$ git show --stat
commit 8ee79997227bf9b34611aee7946ae64735e6fd93
Author: Bryan C. Mills <[email protected]>
Date:   Wed Nov 16 22:31:26 2016 -0500

    descriptor: rename generated protobuf package on import.

    This works around https://github.com/google/go-genproto/issues/8,
    renaming the local package to match its expected name.

 descriptor/descriptor.go      | 2 +-
 descriptor/descriptor_test.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
proto$ cd $GOPATH/src/github.com/golang/protobuf/protoc-gen-go
protoc-gen-go$ git show --stat
commit 8ee79997227bf9b34611aee7946ae64735e6fd93
Author: Bryan C. Mills <[email protected]>
Date:   Wed Nov 16 22:31:26 2016 -0500

    descriptor: rename generated protobuf package on import.

    This works around https://github.com/google/go-genproto/issues/8,
    renaming the local package to match its expected name.

 descriptor/descriptor.go      | 2 +-
 descriptor/descriptor_test.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

google.golang.org/grpc

proto$ cd $GOPATH/src/google.golang.org/grpc
grpc$ git show --stat
commit 5e3de3f21767d4e0e8dd0ee8383bbbfe172d35de
Merge: eca2ad6 b7d24ba
Author: Menghan Li <[email protected]>
Date:   Mon Nov 28 14:26:00 2016 -0800

    Merge pull request #995 from yangmls/master

    correct errors in documentation

 Documentation/grpc-auth-support.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
grpc$ 

I guess your vendored gRPC is outdated.
And did you try to regenerate the file you mentioned vendor/some_grpc_lib/some_lib.pb.go?

I'm not aware of any vendored gRPC in my project. Could you please elaborate?

Also I did regenerate the .proto sources.

In your error message:

# github.com/org/repo/vendor/some_grpc_lib
vendor/some_grpc_lib/some_lib.pb.go:173: undefined: grpc.SupportPackageIsVersion3`

The error happens in some file inside vendor directory. So I guess you are using go vendor.

The original issue can be resolved by updating proto package, gRPC package and rebuilding the proto files. If you are using go vendor, you need to make sure the vendored packages are up to date.

We are having a nightmare of a time dealing with this issue also.

How do you recommend working through it?

Here's an example. We have a developer working on project A who generates their gRPC code with grpc.SupportPackageIsVersion3.

A developer working on project B imports the package with the generated gRPC client from project A. Project B also needs to generate a gRPC server but they generate it with grpc.SupportPackageIsVersion4.

Now the project cannot build.

So you suggest re-generating the protofile from Project A, but this feels weird to us. Now we're changing a vendored file (the generated file) that really should be untouchable since it belongs to Project A.

Also, a lot of our files are difficult to generate in the vendored folder since they rely on imports that are relative to Project's A repo.

Another alternative is to copy/paste the code in the .proto file from Project A to Project B and have Project B generate its own client code. We're duplicating that code and separating it though, so this seems less than ideal as well.

What do you suggest? This really is a huge problem for us and I don't feel like there's a great solution. If you have a single gRPC dependency you are importing then it might be fairly straight-forward, but when you have several that each have several dependencies of their own it becomes a huge pain.

You need to be like Google and work out of one giant repo for all projects... :troll:

One workaround I used is to build the commit prior to the one in the OP:

cd $GOPATH/src/google.golang.org/grpc
git checkout 727a60e
go install

I am also encountering this error.

I ran these commands as per https://github.com/grpc/grpc-go#compiling-error-undefined-grpcsupportpackageisversion

go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc

Then this command to generate the go proto files

protoc --go_out=plugins=grpc:. *.proto

In one of the generated files there is these lines

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

And the error says

/Users/trent/src/github.com/abc/proto/go/def/def.pb.go:195: undefined: grpc.SupportPackageIsVersion3

Running protoc --version gives libprotoc 3.1.0

I tried the fix suggested by @erjoalgo but that didn't work.

This is not rocket science. We simply add a variable grpc.SupportPackageIsVersionX (X is the integer and the current value is 4) to make sure your grpc lib and the generated code work on the same version. We think this is a nice feature so that our users won't blindly mess up different version altogether which may have undefined errors and hard to tackle. In general, if you encounter this problem, check this file (https://github.com/golang/protobuf/blob/master/protoc-gen-go/grpc/grpc.go#L51) and this file (https://github.com/grpc/grpc-go/blob/master/rpc_util.go#L481) for both your project and its dependencies (if they also use gRPC) and see whether they are matched. If they are not, update the repo to make them consistent (you probably need to do additional steps if this happens to your dependencies. I do not want to recommend a way here because this highly depends on your best practice.). Once they are consistent, regenerate all the code. The problem should go away.

@troylelandshields Yes it is a huge pain if your project has a deep dependency tree. But this pain is not specific to grpc. Basically it applies to all the libraries which are used in multiple places in the dependency tree. I think the library should ship with its vendored grpc library, which makes the life much easier.

Thanks @iamqizhao . Issue was an old copy of protoc-gen-go in my path which was in front of github.com/golang/protobuf/protoc-gen-go :) my mistake.

@iamqizhao thank you for reminding me that it's not rocket science.

My point is simply that other non-rocket-scientist people are going to run into this issue as gRPC and Go increase in popularity. They are going to be coming here to look for answers or ask for help as well.

Obviously a lot of thought was put into the decision to add this feature so I think it was fair to assume that we were doing something wrong and you guys must have had a best practice in mind for dealing with this. Apparently the best practice is "deal with it," which is pretty unsatisfactory but we'll figure it out.

It doesn't have to be a "deep dependency tree". If you have one dependency generated by a different version it fails. Ultimately, I think for Go we won't be importing generated code, but each client/consumer will have to generate the client code for their own project. No dependency and no sharing... for better or for worse. Which may be what you were suggesting...

I've encountered this when using: https://hub.docker.com/r/grpc/go

docker run --rm -it -v $PWD/proto:/data grpc/go \ 
  protoc --go_out=plugins=grpc,import_path=data:/data /data/data.proto

It seems that grpc/go image is kind of old. Thus I've downloaded it from: https://github.com/grpc/grpc-docker-library/blob/master/1.0/golang/Dockerfile and recreated. Probably it would make sense refresh the image.

go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc

I just hit this while going through Google's "Building a gRPC service with Node.js" codelab, see https://codelabs.developers.google.com/codelabs/cloud-grpc/index.html?index=..%2F..%2Findex#3

Filed an issue in googlecodelabs/cloud-grpc#5 but posting here too in case anyone here is interested or can help. Thanks!

go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc

On Wed, Feb 1, 2017 at 12:59 PM, jab notifications@github.com wrote:

I just hit this while going through Google's "Building a gRPC service with
Node.js" codelab, see https://codelabs.developers.
google.com/codelabs/cloud-grpc/index.html?index=..%2F..%2Findex#3

Filed an issue in googlecodelabs/cloud-grpc#5
https://github.com/googlecodelabs/cloud-grpc/issues/5 but posting here
too in case anyone here is interested or can help. Thanks!

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/grpc/grpc-go/issues/1002#issuecomment-276780408, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATtnR5sysAwcT8T37YjrhVu-RGzsi5xhks5rYPIogaJpZM4K-XVG
.

@MakMukhi I did that already and still get the same error. Is there anything else you recommend I try? Thanks for trying to help!

Make sure $GOPATH/bin/protoc-gen-go is the updated binary. If not, delete
it and let it regenerate.
It basically boils down to the fact that your generator and grpc code are
not in sync. You'll need to figure out what needs to be update.

On Wed, Feb 1, 2017 at 2:10 PM, jab notifications@github.com wrote:

@MakMukhi https://github.com/MakMukhi I did that already and still get
the same error. Is there anything else you recommend I try? Thanks for
trying to help!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/grpc/grpc-go/issues/1002#issuecomment-276799224, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATtnRxtJn_AnoBADBlR4eHI9Gj_HFjZKks5rYQLUgaJpZM4K-XVG
.

@MakMukhi I just moved aside my entire $GOPATH, reinstalled from scratch, and am getting the same error. Can you not reproduce? Does this show that the issue is not on my end, but rather upstream? Anything else I should try?

 ~ $ echo $GOPATH
/Users/<user>/golang
 ~ $ mv -v $GOPATH $GOPATH.bak
/Users/<user>/golang -> /Users/<user>/golang.bak
 ~ $ which -a protoc-gen-go
 ! ~ $ go get -u -v github.com/golang/protobuf/{proto,protoc-gen-go}
github.com/golang/protobuf (download)
github.com/golang/protobuf/proto
github.com/golang/protobuf/protoc-gen-go/descriptor
github.com/golang/protobuf/protoc-gen-go/plugin
github.com/golang/protobuf/protoc-gen-go/generator
github.com/golang/protobuf/protoc-gen-go/grpc
github.com/golang/protobuf/protoc-gen-go
 ~ $ which -a protoc-gen-go
/Users/<user>/golang/bin/protoc-gen-go
 ~ $ go get -u -v google.golang.org/grpc
Fetching https://google.golang.org/grpc?go-get=1
Parsing meta tags from https://google.golang.org/grpc?go-get=1 (status code 200)
get "google.golang.org/grpc": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc?go-get=1
google.golang.org/grpc (download)
github.com/golang/protobuf (download)
Fetching https://golang.org/x/net/context?go-get=1
Parsing meta tags from https://golang.org/x/net/context?go-get=1 (status code 200)
get "golang.org/x/net/context": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/context?go-get=1
get "golang.org/x/net/context": verifying non-authoritative meta tag
Fetching https://golang.org/x/net?go-get=1
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
golang.org/x/net (download)
Fetching https://golang.org/x/net/http2?go-get=1
Parsing meta tags from https://golang.org/x/net/http2?go-get=1 (status code 200)
get "golang.org/x/net/http2": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/http2?go-get=1
get "golang.org/x/net/http2": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/http2/hpack?go-get=1
Parsing meta tags from https://golang.org/x/net/http2/hpack?go-get=1 (status code 200)
get "golang.org/x/net/http2/hpack": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/http2/hpack?go-get=1
get "golang.org/x/net/http2/hpack": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/idna?go-get=1
Parsing meta tags from https://golang.org/x/net/idna?go-get=1 (status code 200)
get "golang.org/x/net/idna": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/idna?go-get=1
get "golang.org/x/net/idna": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/lex/httplex?go-get=1
Parsing meta tags from https://golang.org/x/net/lex/httplex?go-get=1 (status code 200)
get "golang.org/x/net/lex/httplex": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/lex/httplex?go-get=1
get "golang.org/x/net/lex/httplex": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/trace?go-get=1
Parsing meta tags from https://golang.org/x/net/trace?go-get=1 (status code 200)
get "golang.org/x/net/trace": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/trace?go-get=1
get "golang.org/x/net/trace": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/internal/timeseries?go-get=1
Parsing meta tags from https://golang.org/x/net/internal/timeseries?go-get=1 (status code 200)
get "golang.org/x/net/internal/timeseries": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/internal/timeseries?go-get=1
get "golang.org/x/net/internal/timeseries": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/codes?go-get=1
Parsing meta tags from https://google.golang.org/grpc/codes?go-get=1 (status code 200)
get "google.golang.org/grpc/codes": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/codes?go-get=1
get "google.golang.org/grpc/codes": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc?go-get=1
Parsing meta tags from https://google.golang.org/grpc?go-get=1 (status code 200)
Fetching https://google.golang.org/grpc/credentials?go-get=1
Parsing meta tags from https://google.golang.org/grpc/credentials?go-get=1 (status code 200)
get "google.golang.org/grpc/credentials": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/credentials?go-get=1
get "google.golang.org/grpc/credentials": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/grpclog?go-get=1
Parsing meta tags from https://google.golang.org/grpc/grpclog?go-get=1 (status code 200)
get "google.golang.org/grpc/grpclog": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/grpclog?go-get=1
get "google.golang.org/grpc/grpclog": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/internal?go-get=1
Parsing meta tags from https://google.golang.org/grpc/internal?go-get=1 (status code 200)
get "google.golang.org/grpc/internal": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/internal?go-get=1
get "google.golang.org/grpc/internal": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/metadata?go-get=1
Parsing meta tags from https://google.golang.org/grpc/metadata?go-get=1 (status code 200)
get "google.golang.org/grpc/metadata": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/metadata?go-get=1
get "google.golang.org/grpc/metadata": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/naming?go-get=1
Parsing meta tags from https://google.golang.org/grpc/naming?go-get=1 (status code 200)
get "google.golang.org/grpc/naming": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/naming?go-get=1
get "google.golang.org/grpc/naming": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/stats?go-get=1
Parsing meta tags from https://google.golang.org/grpc/stats?go-get=1 (status code 200)
get "google.golang.org/grpc/stats": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/stats?go-get=1
get "google.golang.org/grpc/stats": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/tap?go-get=1
Parsing meta tags from https://google.golang.org/grpc/tap?go-get=1 (status code 200)
get "google.golang.org/grpc/tap": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/tap?go-get=1
get "google.golang.org/grpc/tap": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/transport?go-get=1
Parsing meta tags from https://google.golang.org/grpc/transport?go-get=1 (status code 200)
get "google.golang.org/grpc/transport": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/transport?go-get=1
get "google.golang.org/grpc/transport": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/peer?go-get=1
Parsing meta tags from https://google.golang.org/grpc/peer?go-get=1 (status code 200)
get "google.golang.org/grpc/peer": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/peer?go-get=1
get "google.golang.org/grpc/peer": verifying non-authoritative meta tag
golang.org/x/net/context
golang.org/x/net/http2/hpack
golang.org/x/net/idna
golang.org/x/net/internal/timeseries
google.golang.org/grpc/codes
golang.org/x/net/lex/httplex
google.golang.org/grpc/credentials
google.golang.org/grpc/grpclog
golang.org/x/net/trace
google.golang.org/grpc/internal
golang.org/x/net/http2
google.golang.org/grpc/metadata
google.golang.org/grpc/naming
google.golang.org/grpc/stats
google.golang.org/grpc/tap
google.golang.org/grpc/peer
google.golang.org/grpc/transport
google.golang.org/grpc
 ~ $ cd src/cloud-grpc/start/
 ~/s/cloud-grpc  master  start $ go run client.go
# _/Users/<user>/src/cloud-grpc/start/books
books/books.pb.go:107: undefined: grpc.SupportPackageIsVersion3

books.pb.go is the code that needs to be regenerated. Quick fix: Inside
books dir, run protoc -I . books.pb.go --go_out=plugins=grpc:.
I'll find out how to get that repo updated.

On Wed, Feb 1, 2017 at 3:03 PM, jab notifications@github.com wrote:

@MakMukhi https://github.com/MakMukhi I just moved aside my entire
$GOPATH, reinstalled from scratch, and am getting the same error. Can you
not reproduce? Does this show that the issue is not on my end, but rather
upstream? Anything else I should try?

~ $ echo $GOPATH
/Users//golang
~ $ mv -v $GOPATH $GOPATH.bak
/Users//golang -> /Users//golang.bak
~ $ which -a protoc-gen-go
! ~ $ go get -u -v github.com/golang/protobuf/{proto,protoc-gen-go}17:56:20 http://github.com/golang/protobuf/%7Bproto,protoc-gen-go%7D17:56:20 2017github.com/golang/protobuf (download)github.com/golang/protobuf/protogithub.com/golang/protobuf/protoc-gen-go/descriptorgithub.com/golang/protobuf/protoc-gen-go/plugingithub.com/golang/protobuf/protoc-gen-go/generatorgithub.com/golang/protobuf/protoc-gen-go/grpcgithub.com/golang/protobuf/protoc-gen-go
~ $ which -a protoc-gen-go
/Users//golang/bin/protoc-gen-go
~ $ go get -u -v google.golang.org/grpc
Fetching https://google.golang.org/grpc?go-get=1
Parsing meta tags from https://google.golang.org/grpc?go-get=1 (status code 200)
get "google.golang.org/grpc": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc?go-get=1google.golang.org/grpc (download)github.com/golang/protobuf (download)
Fetching https://golang.org/x/net/context?go-get=1
Parsing meta tags from https://golang.org/x/net/context?go-get=1 (status code 200)
get "golang.org/x/net/context": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/context?go-get=1
get "golang.org/x/net/context": verifying non-authoritative meta tag
Fetching https://golang.org/x/net?go-get=1
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)golang.org/x/net (download)
Fetching https://golang.org/x/net/http2?go-get=1
Parsing meta tags from https://golang.org/x/net/http2?go-get=1 (status code 200)
get "golang.org/x/net/http2": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/http2?go-get=1
get "golang.org/x/net/http2": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/http2/hpack?go-get=1
Parsing meta tags from https://golang.org/x/net/http2/hpack?go-get=1 (status code 200)
get "golang.org/x/net/http2/hpack": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/http2/hpack?go-get=1
get "golang.org/x/net/http2/hpack": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/idna?go-get=1
Parsing meta tags from https://golang.org/x/net/idna?go-get=1 (status code 200)
get "golang.org/x/net/idna": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/idna?go-get=1
get "golang.org/x/net/idna": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/lex/httplex?go-get=1
Parsing meta tags from https://golang.org/x/net/lex/httplex?go-get=1 (status code 200)
get "golang.org/x/net/lex/httplex": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/lex/httplex?go-get=1
get "golang.org/x/net/lex/httplex": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/trace?go-get=1
Parsing meta tags from https://golang.org/x/net/trace?go-get=1 (status code 200)
get "golang.org/x/net/trace": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/trace?go-get=1
get "golang.org/x/net/trace": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/internal/timeseries?go-get=1
Parsing meta tags from https://golang.org/x/net/internal/timeseries?go-get=1 (status code 200)
get "golang.org/x/net/internal/timeseries": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/internal/timeseries?go-get=1
get "golang.org/x/net/internal/timeseries": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/codes?go-get=1
Parsing meta tags from https://google.golang.org/grpc/codes?go-get=1 (status code 200)
get "google.golang.org/grpc/codes": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/codes?go-get=1
get "google.golang.org/grpc/codes": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc?go-get=1
Parsing meta tags from https://google.golang.org/grpc?go-get=1 (status code 200)
Fetching https://google.golang.org/grpc/credentials?go-get=1
Parsing meta tags from https://google.golang.org/grpc/credentials?go-get=1 (status code 200)
get "google.golang.org/grpc/credentials": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/credentials?go-get=1
get "google.golang.org/grpc/credentials": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/grpclog?go-get=1
Parsing meta tags from https://google.golang.org/grpc/grpclog?go-get=1 (status code 200)
get "google.golang.org/grpc/grpclog": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/grpclog?go-get=1
get "google.golang.org/grpc/grpclog": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/internal?go-get=1
Parsing meta tags from https://google.golang.org/grpc/internal?go-get=1 (status code 200)
get "google.golang.org/grpc/internal": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/internal?go-get=1
get "google.golang.org/grpc/internal": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/metadata?go-get=1
Parsing meta tags from https://google.golang.org/grpc/metadata?go-get=1 (status code 200)
get "google.golang.org/grpc/metadata": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/metadata?go-get=1
get "google.golang.org/grpc/metadata": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/naming?go-get=1
Parsing meta tags from https://google.golang.org/grpc/naming?go-get=1 (status code 200)
get "google.golang.org/grpc/naming": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/naming?go-get=1
get "google.golang.org/grpc/naming": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/stats?go-get=1
Parsing meta tags from https://google.golang.org/grpc/stats?go-get=1 (status code 200)
get "google.golang.org/grpc/stats": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/stats?go-get=1
get "google.golang.org/grpc/stats": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/tap?go-get=1
Parsing meta tags from https://google.golang.org/grpc/tap?go-get=1 (status code 200)
get "google.golang.org/grpc/tap": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/tap?go-get=1
get "google.golang.org/grpc/tap": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/transport?go-get=1
Parsing meta tags from https://google.golang.org/grpc/transport?go-get=1 (status code 200)
get "google.golang.org/grpc/transport": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/transport?go-get=1
get "google.golang.org/grpc/transport": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/peer?go-get=1
Parsing meta tags from https://google.golang.org/grpc/peer?go-get=1 (status code 200)
get "google.golang.org/grpc/peer": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/peer?go-get=1
get "google.golang.org/grpc/peer": verifying non-authoritative meta taggolang.org/x/net/contextgolang.org/x/net/http2/hpackgolang.org/x/net/idnagolang.org/x/net/internal/timeseriesgoogle.golang.org/grpc/codesgolang.org/x/net/lex/httplexgoogle.golang.org/grpc/credentialsgoogle.golang.org/grpc/grpcloggolang.org/x/net/tracegoogle.golang.org/grpc/internalgolang.org/x/net/http2google.golang.org/grpc/metadatagoogle.golang.org/grpc/naminggoogle.golang.org/grpc/statsgoogle.golang.org/grpc/tapgoogle.golang.org/grpc/peergoogle.golang.org/grpc/transportgoogle.golang.org/grpc
~ $ cd src/cloud-grpc/start/
~/s/cloud-grpc master start $ go run client.go

_/Users//src/cloud-grpc/start/books

books/books.pb.go:107: undefined: grpc.SupportPackageIsVersion3

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/grpc/grpc-go/issues/1002#issuecomment-276811874, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATtnR1bcpoUfexxZ9uhuBLvL2TTfhLN1ks5rYQ9XgaJpZM4K-XVG
.

Also, this could serve as a nice quickstart for grpc-go
https://github.com/grpc/grpc.github.io/blob/master/docs/quickstart/go.md

On Wed, Feb 1, 2017 at 3:14 PM, Mahak Mukhi mmukhi@google.com wrote:

books.pb.go is the code that needs to be regenerated. Quick fix: Inside
books dir, run protoc -I . books.pb.go --go_out=plugins=grpc:.
I'll find out how to get that repo updated.

On Wed, Feb 1, 2017 at 3:03 PM, jab notifications@github.com wrote:

@MakMukhi https://github.com/MakMukhi I just moved aside my entire
$GOPATH, reinstalled from scratch, and am getting the same error. Can you
not reproduce? Does this show that the issue is not on my end, but rather
upstream? Anything else I should try?

~ $ echo $GOPATH
/Users//golang
~ $ mv -v $GOPATH $GOPATH.bak
/Users//golang -> /Users//golang.bak
~ $ which -a protoc-gen-go
! ~ $ go get -u -v github.com/golang/protobuf/{proto,protoc-gen-go}17:56:20 http://github.com/golang/protobuf/%7Bproto,protoc-gen-go%7D17:56:20 2017github.com/golang/protobuf (download)github.com/golang/protobuf/protogithub.com/golang/protobuf/protoc-gen-go/descriptorgithub.com/golang/protobuf/protoc-gen-go/plugingithub.com/golang/protobuf/protoc-gen-go/generatorgithub.com/golang/protobuf/protoc-gen-go/grpcgithub.com/golang/protobuf/protoc-gen-go
~ $ which -a protoc-gen-go
/Users//golang/bin/protoc-gen-go
~ $ go get -u -v google.golang.org/grpc
Fetching https://google.golang.org/grpc?go-get=1
Parsing meta tags from https://google.golang.org/grpc?go-get=1 (status code 200)
get "google.golang.org/grpc": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc?go-get=1google.golang.org/grpc (download)github.com/golang/protobuf (download)
Fetching https://golang.org/x/net/context?go-get=1
Parsing meta tags from https://golang.org/x/net/context?go-get=1 (status code 200)
get "golang.org/x/net/context": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/context?go-get=1
get "golang.org/x/net/context": verifying non-authoritative meta tag
Fetching https://golang.org/x/net?go-get=1
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)golang.org/x/net (download)
Fetching https://golang.org/x/net/http2?go-get=1
Parsing meta tags from https://golang.org/x/net/http2?go-get=1 (status code 200)
get "golang.org/x/net/http2": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/http2?go-get=1
get "golang.org/x/net/http2": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/http2/hpack?go-get=1
Parsing meta tags from https://golang.org/x/net/http2/hpack?go-get=1 (status code 200)
get "golang.org/x/net/http2/hpack": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/http2/hpack?go-get=1
get "golang.org/x/net/http2/hpack": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/idna?go-get=1
Parsing meta tags from https://golang.org/x/net/idna?go-get=1 (status code 200)
get "golang.org/x/net/idna": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/idna?go-get=1
get "golang.org/x/net/idna": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/lex/httplex?go-get=1
Parsing meta tags from https://golang.org/x/net/lex/httplex?go-get=1 (status code 200)
get "golang.org/x/net/lex/httplex": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/lex/httplex?go-get=1
get "golang.org/x/net/lex/httplex": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/trace?go-get=1
Parsing meta tags from https://golang.org/x/net/trace?go-get=1 (status code 200)
get "golang.org/x/net/trace": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/trace?go-get=1
get "golang.org/x/net/trace": verifying non-authoritative meta tag
Fetching https://golang.org/x/net/internal/timeseries?go-get=1
Parsing meta tags from https://golang.org/x/net/internal/timeseries?go-get=1 (status code 200)
get "golang.org/x/net/internal/timeseries": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/internal/timeseries?go-get=1
get "golang.org/x/net/internal/timeseries": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/codes?go-get=1
Parsing meta tags from https://google.golang.org/grpc/codes?go-get=1 (status code 200)
get "google.golang.org/grpc/codes": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/codes?go-get=1
get "google.golang.org/grpc/codes": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc?go-get=1
Parsing meta tags from https://google.golang.org/grpc?go-get=1 (status code 200)
Fetching https://google.golang.org/grpc/credentials?go-get=1
Parsing meta tags from https://google.golang.org/grpc/credentials?go-get=1 (status code 200)
get "google.golang.org/grpc/credentials": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/credentials?go-get=1
get "google.golang.org/grpc/credentials": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/grpclog?go-get=1
Parsing meta tags from https://google.golang.org/grpc/grpclog?go-get=1 (status code 200)
get "google.golang.org/grpc/grpclog": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/grpclog?go-get=1
get "google.golang.org/grpc/grpclog": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/internal?go-get=1
Parsing meta tags from https://google.golang.org/grpc/internal?go-get=1 (status code 200)
get "google.golang.org/grpc/internal": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/internal?go-get=1
get "google.golang.org/grpc/internal": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/metadata?go-get=1
Parsing meta tags from https://google.golang.org/grpc/metadata?go-get=1 (status code 200)
get "google.golang.org/grpc/metadata": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/metadata?go-get=1
get "google.golang.org/grpc/metadata": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/naming?go-get=1
Parsing meta tags from https://google.golang.org/grpc/naming?go-get=1 (status code 200)
get "google.golang.org/grpc/naming": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/naming?go-get=1
get "google.golang.org/grpc/naming": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/stats?go-get=1
Parsing meta tags from https://google.golang.org/grpc/stats?go-get=1 (status code 200)
get "google.golang.org/grpc/stats": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/stats?go-get=1
get "google.golang.org/grpc/stats": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/tap?go-get=1
Parsing meta tags from https://google.golang.org/grpc/tap?go-get=1 (status code 200)
get "google.golang.org/grpc/tap": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/tap?go-get=1
get "google.golang.org/grpc/tap": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/transport?go-get=1
Parsing meta tags from https://google.golang.org/grpc/transport?go-get=1 (status code 200)
get "google.golang.org/grpc/transport": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/transport?go-get=1
get "google.golang.org/grpc/transport": verifying non-authoritative meta tag
Fetching https://google.golang.org/grpc/peer?go-get=1
Parsing meta tags from https://google.golang.org/grpc/peer?go-get=1 (status code 200)
get "google.golang.org/grpc/peer": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc/peer?go-get=1
get "google.golang.org/grpc/peer": verifying non-authoritative meta taggolang.org/x/net/contextgolang.org/x/net/http2/hpackgolang.org/x/net/idnagolang.org/x/net/internal/timeseriesgoogle.golang.org/grpc/codesgolang.org/x/net/lex/httplexgoogle.golang.org/grpc/credentialsgoogle.golang.org/grpc/grpcloggolang.org/x/net/tracegoogle.golang.org/grpc/internalgolang.org/x/net/http2google.golang.org/grpc/metadatagoogle.golang.org/grpc/naminggoogle.golang.org/grpc/statsgoogle.golang.org/grpc/tapgoogle.golang.org/grpc/peergoogle.golang.org/grpc/transportgoogle.golang.org/grpc
~ $ cd src/cloud-grpc/start/
~/s/cloud-grpc master start $ go run client.go

_/Users//src/cloud-grpc/start/books

books/books.pb.go:107: undefined: grpc.SupportPackageIsVersion3

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/grpc/grpc-go/issues/1002#issuecomment-276811874, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATtnR1bcpoUfexxZ9uhuBLvL2TTfhLN1ks5rYQ9XgaJpZM4K-XVG
.

@MakMukhi Thanks for continuing to debug with me. I tried your quick fix and here is what happened:

$ pwd
/Users/<user>/src/cloud-grpc
$ head .git/config
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "origin"]
    url = https://github.com/googlecodelabs/cloud-grpc
    fetch = +refs/heads/*:refs/remotes/origin/*
$ git pull
Already up-to-date.
$ cd start/books
$ protoc -I . books.pb.go --go_out=plugins=grpc:.
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: books.pb.go. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
books.pb.go:30:1: Expected ";".
books.pb.go:53:1: Expected top-level statement (e.g. "message").

Anything else you suggest so I can get past this? Thanks again!

Wait, my bad; That needs to books.proto protoc -I . books.proto
--go_out=plugins=grpc:.
But I see that they haven't provided books proto file.
Another quick fix: update the books.pb.go file yourself:

  1. Update all occurrences of grpc.SupportPackageIsVersion3 to
    grpc.SupportPackageIsVersion4
  2. Replace Metadata: fileDescriptor0 with Metadata: "books.proto"

Hope they update repo soon, meanwhile this should work.

On Wed, Feb 1, 2017 at 3:20 PM, jab notifications@github.com wrote:

@MakMukhi https://github.com/MakMukhi Thanks for continuing to debug
with me. I tried your quick fix and here is what happened:

$ pwd
/Users/bronsonj/src/cloud-grpc
$ head .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/googlecodelabs/cloud-grpc
fetch = +refs/heads/:refs/remotes/origin/
$ git pull
Already up-to-date.
$ cd start/books
$ protoc -I . books.pb.go --go_out=plugins=grpc:.
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: books.pb.go. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
books.pb.go:30:1: Expected ";".
books.pb.go:53:1: Expected top-level statement (e.g. "message").

Anything else you suggest so I can get past this? Thanks again!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/grpc/grpc-go/issues/1002#issuecomment-276815483, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATtnRzVmYKgAGelo-1Fk5foamaw3bZ6Lks5rYRMsgaJpZM4K-XVG
.

Thanks so much @MakMukhi, I think that did the trick! Added the exact patch to https://github.com/googlecodelabs/cloud-grpc/issues/5#issuecomment-276835746 in case it helps someone else in the future.

Thanks for the review. I'll submit the update later today.

I solve a similar problem ,
see https://github.com/grpc/grpc-go/releases,
coment on v1.0.4 version is SupportPackageIsVersion4.
so when my protoc-gen-go generate still SupportPackageIsVersion3 , it can not work .
then I download grpc-go v1.0.0, the two version is match, it work again.

Was this page helpful?
0 / 5 - 0 ratings