python protobuf: incomplete file?

Skip to first unread message

Nelson Meyer

Oct 25, 2022, 6:22:42 AM10/25/22
to Protocol Buffers
Hi everyone,
I hope, this is the right place to ask this question. If not feel free to refer me elsewhere.

Some installation details:
- I have installed the python protobuf according to this guide:
- I have put the binary from in /usr/local/bin and this path is at first place in the PATH variable
- the tests ran fine (Output: Ran 911 tests in 25.761s, OK (skipped=9))

The generated file does not seem to be complete.
It contains:

_sym_db = _symbol_database.Default()

DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19jfinder_duplicate.proto\x12\tjfinder\"\xef\x06\n\rduplicate_ads\x12\x10\n\x03\x63id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x12\n\x05\x62q_id\x18\x14 \x01(\x05H\x01\x88\x01\x01\x12\x16\n\tj_title\x18\x02 \x01(\tH\x02\x88\x01\x01 ...................................x06proto3')

_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'jfinder_duplicate_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:

DESCRIPTOR._options = None

What seems to be missing:
_DUPLICATE_ADS = .... and _JOB_HASHES =.......
duplicate_ads = _reflection.GeneratedProtocolMessageType( .......
j_hashes = _reflection.GeneratedProtocolMessageType(.....

Consequence: Bigquery upload fails.

From what I know, the protoc files and generation using this installation have worked before, but I had to try a new installation due to the error:
TypeError: Descriptors cannot not be created directly. If this call came from a file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.

Do you have any suggestion on how I can solve this problem?

Many thanks in advance!

Nelson Meyer

Oct 28, 2022, 11:24:10 AM10/28/22
to Protocol Buffers
Just to let you know, that I solved the problem and it had nothing to do with the files.
Sorry for the "false alarm". Thanks!

Rodrigo Schramm

Jul 29, 2023, 5:26:57 AM7/29/23
to Protocol Buffers
Hi. I am having the same issue. How did you solve this?
Reply all
Reply to author
0 new messages