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

Python runtime 4.21.10 not works generated code can not load valid proto. #11171

Closed
ChameleonRed opened this issue Dec 6, 2022 · 6 comments
Closed
Assignees

Comments

@ChameleonRed
Copy link

ChameleonRed commented Dec 6, 2022

What version of protobuf and what language are you using?
Version: 4.21.10
Language: Python

What operating system (Linux, Windows, ...) and version?
Windows

What runtime / compiler are you using (e.g., python version or gcc version)
3.10.8

What did you do?
Same steps like here:
#10686

What did you expect to see
No problems with loading.

What did you see instead?

# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: etcd/api/versionpb/version.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()


from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2
from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2


DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n etcd/api/versionpb/version.proto\x12\tversionpb\x1a\x14gogoproto/gogo.proto\x1a google/protobuf/descriptor.proto:>\n\x10\x65tcd_version_msg\x12\x1f.google.protobuf.MessageOptions\x18\xd0\x86\x03 \x01(\t\x88\x01\x01:>\n\x12\x65tcd_version_field\x12\x1d.google.protobuf.FieldOptions\x18\xd1\x86\x03 \x01(\t\x88\x01\x01:<\n\x11\x65tcd_version_enum\x12\x1c.google.protobuf.EnumOptions\x18\xd2\x86\x03 \x01(\t\x88\x01\x01:G\n\x17\x65tcd_version_enum_value\x12!.google.protobuf.EnumValueOptions\x18\xd3\x86\x03 \x01(\t\x88\x01\x01\x42\x08\xc8\xe2\x1e\x01\xd0\xe2\x1e\x01\x62\x06proto3')
  File "C:\Users\Cezary Wagner\PycharmProjects\medptr-v2\src\etcd3_grpc\grpc\etcd\api\versionpb\version_pb2.py", line 18, in <module>
    DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n etcd/api/versionpb/version.proto\x12\tversionpb\x1a\x14gogoproto/gogo.proto\x1a google/protobuf/descriptor.proto:>\n\x10\x65tcd_version_msg\x12\x1f.google.protobuf.MessageOptions\x18\xd0\x86\x03 \x01(\t\x88\x01\x01:>\n\x12\x65tcd_version_field\x12\x1d.google.protobuf.FieldOptions\x18\xd1\x86\x03 \x01(\t\x88\x01\x01:<\n\x11\x65tcd_version_enum\x12\x1c.google.protobuf.EnumOptions\x18\xd2\x86\x03 \x01(\t\x88\x01\x01:G\n\x17\x65tcd_version_enum_value\x12!.google.protobuf.EnumValueOptions\x18\xd3\x86\x03 \x01(\t\x88\x01\x01\x42\x08\xc8\xe2\x1e\x01\xd0\xe2\x1e\x01\x62\x06proto3')
TypeError: Couldn't build proto file into descriptor pool: field with proto3_optional was not in a oneof (versionpb.etcd_version_msg)

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment

@ChameleonRed ChameleonRed added the untriaged auto added to all issues by default when created. label Dec 6, 2022
@esorot esorot added bug python and removed untriaged auto added to all issues by default when created. labels Dec 9, 2022
@haberman
Copy link
Member

This was previously fixed in protocolbuffers/upb#820, but the fix has not been backported to the release branch.

@haberman
Copy link
Member

This fix has been backported and will be released shortly.

@vishaldhanani
Copy link

@haberman, Is there any particular timeline to release new versions with fixes for python?

@ChameleonRed
Copy link
Author

@haberman Can you figure out deadline? I waiting for it months so your fix will be welcome.

@haberman
Copy link
Member

This fix was released in 4.21.12, released on December 14: https://github.com/protocolbuffers/protobuf/releases/tag/v21.12

Are you still getting this error with 4.21.12?

@ChameleonRed
Copy link
Author

I will try in next 1-4 weeks ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants