Grpc-go: Getting error undefined: grpc.SupportPackageIsVersion6 and undefined: grpc.ClientConnInterface

Created on 30 Jan 2020  路  14Comments  路  Source: grpc/grpc-go

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

Working As Intended Question

Most helpful comment

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.

All 14 comments

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.

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

why this issue is closed.

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

google.golang.org/grpc v1.27.0

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

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

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.

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.

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

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.

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

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

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

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

Was this page helpful?
0 / 5 - 0 ratings