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

Getting error undefined: grpc.SupportPackageIsVersion6 and undefined: grpc.ClientConnInterface #3347

Closed
belwalkar opened this issue Jan 30, 2020 · 17 comments

Comments

@belwalkar
Copy link

Please see the FAQ in our main README.md before submitting your issue.
I could compile till yesterday and suddenly today started getting this error
libprotoc 3.2.0
github.com/grpc-ecosystem/grpc-gateway v1.12.1

@dfawley
Copy link
Member

dfawley commented Jan 30, 2020

You will need to use a newer version of grpc or an older version of protoc-gen-go (to produce your .pb.go files). If you are using modules, you should have a go.mod in the module with the .pb.go files with a line that requires grpc-go @v1.27.0.

@dfawley dfawley closed this as completed Jan 30, 2020
@belwalkar
Copy link
Author

root@ip-10-5-1-6:~/cord/device-management# cat go.mod
module github.com/opencord/device-management

go 1.12

require (
github.com/Shopify/sarama v1.26.0
github.com/golang/protobuf v1.3.2
github.com/grpc-ecosystem/grpc-gateway v1.12.1 // indirect
github.com/klauspost/cpuid v1.2.1 // indirect
github.com/sirupsen/logrus v1.4.2
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 // indirect
golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 // indirect
google.golang.org/grpc v1.26.0
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc // indirect
)

I dont have grpc-go

@belwalkar
Copy link
Author

why this issue is closed.

@belwalkar
Copy link
Author

ENV PROTOC_VERSION="3.7.0"
github.com/grpc-ecosystem/grpc-gateway v1.12.2 // indrect
google.golang.org/grpc v1.27.0

combination fixed issue

@dfawley
Copy link
Member

dfawley commented Jan 30, 2020

google.golang.org/grpc v1.27.0

This line will make sure that such an error is impossible.

@belwalkar
Copy link
Author

Does that mean protoc version and grpc-gateway version dosent matter

@dfawley
Copy link
Member

dfawley commented Jan 30, 2020

In this case, that's correct. The latest version of grpc-go will support all versions of the generated code.

Your other option would have been to downgrade the protoc-gen-go (from github.com/golang/protobuf) version to the previous release (1.3.2) before generating the .pb.go files. I see your go.mod says protobuf is 1.3.2, but you must have compiled the protoc-gen-go binary with 1.3.3 (or master@HEAD). Note that the protoc version itself is also irrelevant.

@alan-ma-umg
Copy link

I just updated my go.mod with go get -u google.golang.org/grpc. Saw the version changed from 1.26.0 to 1.27.0. Then all my proto gen code stopped complaining undefined grpc.SupportPackageIsVersion6.

@timothyleung1
Copy link

I am having problem with undefined grpc.ClientConnInterface as well.

Have v1.27 in my WORKSPACE file ..

Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: error running subcommand: exit status 2
/private/var/tmp/_bazel_tim/8d52925ad011cfdb3758a825d7ae7a61/sandbox/darwin-sandbox/448/execroot/__main__/external/org_golang_google_api/internal/conn_pool.go:29:2: undefined: grpc.ClientConnInterface

@nicolai86
Copy link

nicolai86 commented Feb 29, 2020

fwiw, my go.mod contains
require github.com/golang/protobuf v1.3.2 as well as require github.com/golang/protobuf v1.3.4
and I still get this error with bazel and rules_go v0.22.1. Downgrading rules_go to v0.21.3 fixes the issue, but it also means I'm stuck on go < 1.14.

NatalieDoduc added a commit to NatalieDoduc/trillian that referenced this issue Mar 6, 2020
Update generated pb files from tip of tree. The changes here are a
result of changes in the dependency chain and tooling. No changes in
code are included in this PR.

Note that a manual update to grpc was done via `go get -u
google.golang.org/grpc` as per suggestion by
grpc/grpc-go#3347 (comment).
@Eson-Jia
Copy link

Eson-Jia commented Jun 5, 2020

for google.golang.org/grpc v1.26.0,I usego get github.com/golang/protobuf/protoc-gen-go@v1.3.2to downgrade the version of protoc-gen-go to v.1.3.2,then rebuild proto file, problem has been resolved.

@johnbellone
Copy link

I haven't been able to get past this part even with the suggestion that @Eson-Jia had.

@Windrill
Copy link

Windrill commented Jun 18, 2020

Mine worked for protoc-gen-go version 1.3.0, protoc (libprotoc) version 3.11.2, which was a downgrade from the latest protoc-gen-go version, while the relatively recent protoc's version stayed the same.
Not sure if this meant the the newest protoc currently could not support the newest protoc-gen-go.
github.com/golang/protobuf/protoc-gen-go's version can be changed via git checkout and installing, if the dependency is contained within the gopath/project.
eg. https://stackoverflow.com/questions/53952723/undefined-proto-protopackageisversion3

@johnbellone
Copy link

I got it working but had to drop Bazel. It was likely due to my lack of experience with tweaking it.

@hikergit
Copy link

for google.golang.org/grpc v1.26.0,I usego get github.com/golang/protobuf/protoc-gen-go@v1.3.2to downgrade the version of protoc-gen-go to v.1.3.2,then rebuild proto file, problem has been resolved.

@Eson-Jia Thanks for the advise, that works for me too. Looks like google.golang.org/grpc v1.26.0 and github.com/golang/protobuf/protoc-gen-go v1.3.2 is a good match. Could you share how you find this out? I hope the grpc official documentation includes a compatibility table.

@dfawley
Copy link
Member

dfawley commented Apr 22, 2021

google.golang.org/grpc v1.26.0

We don't really support this version of grpc-go anymore. You should be using one of the last 3 releases if at all possible. FWIW we have an example for generating protobuf code here: https://grpc.io/docs/languages/go/quickstart/#regenerate-grpc-code

@storyicon
Copy link

storyicon commented Jul 23, 2021

You can try installing an older version of protoc-gen-go-grpc through:

go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@ad51f572fd270f2323e3aa2c1d2775cab9087af2

But I would recommend you to use PowerProto
You can use it for one-click installation, one-click compilation and version control.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants