Grpc-go: undefined: proto.InternalMessageInfo

Created on 22 May 2018  路  4Comments  路  Source: grpc/grpc-go

Using version:
a36eb4675a1a7cbb473953b7cb273855c3bd555a

Go version:
go version go1.10.2 darwin/amd64

OS:
MacOS

Issue description:
I have a go project(whose dependency is managed by glide) that has an indirect dependency on grpc. I say this because although "google.golang.org/grpc" does not appear in glide.yaml, it does gets listed in glide.lock after I run "glide install", which leads me to think one or more of the dependency's listed in glide.yaml must indirectly depend on grpc.

When I run "make" to build my project, I expect it to build clean. However, I'm seeing errors

.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:59:30: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:112:31: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:160:40: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:302:47: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:358:33: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:441:41: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:590:48: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:639:32: undefined: proto.InternalMessageInfo
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go:698:28: undefined: proto.InternalMessageInfo
# code.uber.internal/summer/summer-test-service/vendor/google.golang.org/genproto/googleapis/rpc/status
.tmp/.goroot/src/code.uber.internal/summer/summer-test-service/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go:111:28: undefined: proto.InternalMessageInfo

I have a hunch that this is related to these issues listed here:
https://github.com/brocaar/lora-app-server/issues/234
https://github.com/google/protobuf/issues/4582
though I do not quite understand why no body else is running into this.

My rudimentary understanding of this is that the new code generator was emitting out code no longer supported by protobuf, namely the proto.InternalMessageInfo type?

Current workaround is:
I manually set the version of grpc in glide.lock to a git SHA before proto.InternalMessageInfo is added to messages.pb.go file.

Any insights or explanations would be welcome.

Most helpful comment

Run go get -u github.com/golang/protobuf/{proto,protoc-gen-go} to update your local proto and protoc-gen-go should the solve the problem.
We regenerated pb.go files (#2039) using the latest proto and protoc-gen-go to keep them update. And if you are still using the old version of them, then the error you saw will occur.

All 4 comments

Run go get -u github.com/golang/protobuf/{proto,protoc-gen-go} to update your local proto and protoc-gen-go should the solve the problem.
We regenerated pb.go files (#2039) using the latest proto and protoc-gen-go to keep them update. And if you are still using the old version of them, then the error you saw will occur.

Hi thanks for the answer. I solved the problem a different way, but you were on point about the root cause, which was proto and protoc-gen-go being out of date.

However, because my project's dependency was managed by glide, I couldn't just manually "go get" the latest proto and protoc-gen-go because that would defeat the purpose of using glide.

In my case, there was some stale dependencies specified in my glide.yaml that was hard locking proto to a specific version that was too old for grpc.

So I fixed the issue by cleaning up/updating my glide.yaml, removing anything that looks out of date and got rid of as much hard coded versioning as possible, then I regenerated glide.lock and this time the latest version of proto was recorded in glide.lock and my project built clean.

 go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
# github.com/golang/protobuf/protoc-gen-go/descriptor
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:352:39: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:413:41: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:540:37: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:643:52: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:699:51: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:754:43: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:822:42: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:925:42: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:980:41: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:1053:59: undefined: proto.InternalMessageInfo
protobuf/protoc-gen-go/descriptor/descriptor.pb.go:1053:59: too many errors

delete and go get -u github.com/golang/protobuf/{proto,protoc-gen-go}

Was this page helpful?
0 / 5 - 0 ratings