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

gogo/proto marshalling is failing with latest github.com/golang/protobuf v1.4.0-rc.4 #678

Open
adithya66 opened this issue Apr 13, 2020 · 6 comments
Labels
apiv2 Issues blocking Go protobuf APIv2 compatibility

Comments

@adithya66
Copy link

panic: protobuf tag not enough fields in ListDeviceRequest.state:

goroutine 25 [running]:
github.com/gogo/protobuf/proto.(*unmarshalInfo).computeUnmarshalInfo(0xc000162000)
/Users/adithyas/go/pkg/mod/github.com/gogo/[email protected]/proto/table_unmarshal.go:341 +0x17fb

@stevvooe
Copy link
Contributor

I've seen a similar issue:

panic: protobuf tag not enough fields in FileDescriptorSet.state:
goroutine 1 [running]:
github.com/gogo/protobuf/proto.(*unmarshalInfo).computeUnmarshalInfo(0xc000090820)
        /go/src/github.com/gogo/protobuf/proto/table_unmarshal.go:341 +0x17fb
github.com/gogo/protobuf/proto.(*unmarshalInfo).unmarshal(0xc000090820, 0xc00008a5c0, 0xc000320000, 0x4752, 0x4952, 0x40c338, 0x20)
        /go/src/github.com/gogo/protobuf/proto/table_unmarshal.go:138 +0xe13
github.com/gogo/protobuf/proto.(*InternalMessageInfo).Unmarshal(0xc000077940, 0x7b0780, 0xc00008a5c0, 0xc000320000, 0x4752, 0x4952, 0xc00008a501, 0x0)
        /go/src/github.com/gogo/protobuf/proto/table_unmarshal.go:63 +0x66
github.com/gogo/protobuf/proto.(*Buffer).Unmarshal(0xc00010b440, 0x7b0780, 0xc00008a5c0, 0x0, 0x0)
        /go/src/github.com/gogo/protobuf/proto/decode.go:424 +0x1ec
github.com/gogo/protobuf/proto.Unmarshal(0xc000320000, 0x4752, 0x4952, 0x7b0780, 0xc00008a5c0, 0x0, 0x0)
        /go/src/github.com/gogo/protobuf/proto/decode.go:342 +0x170
main.readDesc(0xc000083300, 0x1d, 0x0, 0x0, 0x0)
        /go/src/github.com/stevvooe/protobuild/descriptors.go:96 +0x9e
main.main()
        /go/src/github.com/stevvooe/protobuild/main.go:218 +0x1819
make: *** [Makefile:143: protos] Error 2

@DisposaBoy
Copy link

Try rolling back golang/protobuf: go get github.com/golang/[email protected]

@adithya66
Copy link
Author

I cannot other modules require at least protobuf v1.4.0-rc.4.
for Example: https://github.com/openconfig/ygot/blob/master/go.mod
so my go.mod automatically updates with latest versionof protobuf.

@FelixSeptem
Copy link

due to https://blog.golang.org/protobuf-apiv2 version part will show some clues, try to upgrade a stable version like v1.4.0

@FelixSeptem
Copy link

https://github.com/openconfig/ygot/blob/master/go.mod

look go.mod of google.golang.org/protobuf , you will get answer

@johanbrandhorst johanbrandhorst added the apiv2 Issues blocking Go protobuf APIv2 compatibility label Aug 21, 2020
klizhentas added a commit to gravitational/teleport that referenced this issue Oct 14, 2020
This comit fixes #4508

Gogoproto is not compatible with APIv2 protoc-gen-go.
Track the issue here: gogo/protobuf#678
Meanwhile, this commit switches to google protobuf to unmarshal firebase struct.

Add a missing method EmitAuditEvent causing teleport to crash
with firestore events backend.
klizhentas added a commit to gravitational/teleport that referenced this issue Oct 14, 2020
This comit fixes #4508

Gogoproto is not compatible with APIv2 protoc-gen-go.
Track the issue here: gogo/protobuf#678
Meanwhile, this commit switches to google protobuf to unmarshal firebase struct.

Add a missing method EmitAuditEvent causing teleport to crash
with firestore events backend.
klizhentas added a commit to gravitational/teleport that referenced this issue Oct 15, 2020
This comit fixes #4508

Gogoproto is not compatible with APIv2 protoc-gen-go.
Track the issue here: gogo/protobuf#678
Meanwhile, this commit switches to google protobuf to unmarshal firebase struct.

Add a missing method EmitAuditEvent causing teleport to crash
with firestore events backend.
klizhentas added a commit to gravitational/teleport that referenced this issue Oct 15, 2020
This comit fixes #4508

Gogoproto is not compatible with APIv2 protoc-gen-go.
Track the issue here: gogo/protobuf#678
Meanwhile, this commit switches to google protobuf to unmarshal firebase struct.

Add a missing method EmitAuditEvent causing teleport to crash
with firestore events backend.
@joe-elliott
Copy link

joe-elliott commented Feb 26, 2021

We were seeing similar issues. Our error is:

panic: invalid Go type model.TraceID for field jaeger.api_v2.SpanRef.trace_id [recovered]
	panic: invalid Go type model.TraceID for field jaeger.api_v2.SpanRef.trace_id

For us issues were triggering on types with custom marshalling/unmarshalling. We are able to fix the issue by using the experimental encoding.RegisterCodec method. We are currently evaluating whether this is a go forward fix for us.

https://github.com/joe-elliott/jaeger/blob/53a4d9d2b6387021c4b97d4b96171e222f181907/proto-gen/api_v2/init.go

I am unfamiliar with the mechanics that grpc uses to choose a codec, why it worked before or why it stopped working. Perhaps this sheds some light on the problem for those who know more about this issue.

Edit:

We were able to make it quite far using this technique but were ultimately blocked by the following error:

panic: protobuf tag not enough fields in Empty.state:

Details here:
jaegertracing/jaeger#2857 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apiv2 Issues blocking Go protobuf APIv2 compatibility
Projects
None yet
Development

No branches or pull requests

6 participants