Protobuf: undefined field

Created on 30 Apr 2018  路  5Comments  路  Source: protocolbuffers/protobuf

I just generated some new protobuf .pb.go files. WhenI go to build I get this error "undefined: proto.InternalMessageInfo".

I know this is because of the new branch that was merged in today https://groups.google.com/forum/#!topic/protobuf/N-elvFu4dFM. I just want my code to compile.
Any suggestions?

invalid

Most helpful comment

I had the same issue today. There are two solutions:

  1. Either use an older version of the plugin i.e. manually download and install protoc-gen-go release v1.1.0 (https://github.com/golang/protobuf/releases/tag/v1.0.0) to generate proto code in the old style.
  2. Use the right dependency version: You should have github.com/golang/protobuf somewhere in your project dependencies, you need to bump its version to v1.1.0 and run dep ensure (or appropriate glide command). Then, compilation succeeds with the new types above.

All 5 comments

We are having the same issue.

Can you report this to https://github.com/golang/protobuf ? The protobuf go generator and runtime is hosted in a different repository.

I had the same issue today. There are two solutions:

  1. Either use an older version of the plugin i.e. manually download and install protoc-gen-go release v1.1.0 (https://github.com/golang/protobuf/releases/tag/v1.0.0) to generate proto code in the old style.
  2. Use the right dependency version: You should have github.com/golang/protobuf somewhere in your project dependencies, you need to bump its version to v1.1.0 and run dep ensure (or appropriate glide command). Then, compilation succeeds with the new types above.

Here is some more information on this issue; with a heads-up dating back to Jan: https://groups.google.com/forum/#!topic/golang-nuts/F5xFHTfwRnY

It's fixed after update vendor.

Was this page helpful?
0 / 5 - 0 ratings