Skip to content

Collision with protobuf runtime and provided proto files after pip installation - Detected incompatible Protobuf Gencode/Runtime versions #54

@psch0rr

Description

@psch0rr

Hey there,

I was facing a strange protobuf versioning issue during the installation of the kuksa-client.

I was using pip install kuksa-client to install the current version 0.5.1. So far so good, it was resolving all the needed dependencies to make the kuksa-client runnable.
The protobuf version is defined by the grpcio-tools dependency, which requires anything above 5.26.1, in our case it was 5.27.3, so no upgrade performed during the installation. (see below)

sudo pip install kuksa-client
Collecting kuksa-client

...
 Using cached kuksa_client-0.5.1-py3-none-any.whl (82 kB)Requirement already satisfied: protobuf<6.0dev,>=5.26.1 in 
/usr/local/lib/python3.10/dist-packages (from grpcio-tools==1.68.0->kuksa-client) (5.27.3)
...

Installing collected packages: kuksa-client
Successfully installed kuksa-client-0.5.1

Ok still good, the issue started as soon as I was starting my application:

It raises a runtime and generation version error: google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime.
It seems that the shipped protofiles from you are generated using the 5.28.1 version. So they are not compatible, or at least raise this error, if you do a normal installation using pip.

Feb 11 14:22:44 fgvt-ivs-11-au bash[1441142]:   File "/usr/local/lib/python3.10/dist-packages/kuksa/val/v1/types_pb2.py", line 12, in <module>
Feb 11 14:22:44 fgvt-ivs-11-au bash[1441142]:     _runtime_version.ValidateProtobufRuntimeVersion(
Feb 11 14:22:44 fgvt-ivs-11-au bash[1441142]:   File "/usr/local/lib/python3.10/dist-packages/google/protobuf/runtime_version.py", line 86, in ValidateProtobufRuntimeVersion
Feb 11 14:22:44 fgvt-ivs-11-au bash[1441142]:     raise VersionError(
Feb 11 14:22:44 fgvt-ivs-11-au bash[1441142]: google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading kuksa/val/v1/types.proto: gencode 5.28.1 runtime 5.27.3. Runtime version cannot be older than the linked gencode version. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.

Solution

Solution was to manually upgrade protobuf to 5.29.6, what is the latest compatible version of Protobuf supporting the grpcio-tools==1.68.0 what is mandatory for the kuksa-client.
The current protobuf-6.33.5 only works with grpcio-tools-1.78.0, no longer with the grpcio-tools-1.68.0

Question

Is is possible to add a protobuf version to the pip dependencies equal or above the proto gen version to ensure that the installation is working again ootb?

Thanks a lot and best regards
Philipp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions