Skip to content

fix: increase minimum protobuf version to 6.31.1#318

Merged
kohlisid merged 1 commit intonumaproj:mainfrom
khneal:fix/gencode_runtime_minimum_version
Feb 13, 2026
Merged

fix: increase minimum protobuf version to 6.31.1#318
kohlisid merged 1 commit intonumaproj:mainfrom
khneal:fix/gencode_runtime_minimum_version

Conversation

@khneal
Copy link
Contributor

@khneal khneal commented Feb 11, 2026

What

Increase the minimum version of package "protobuf" to 6.31.1

Why

Using an older (lower) version of protobuf causes a runtime error.

To reproduce:

$ uv venv
...
$ uv pip install "pynumaflow @ git+https://github.com/numaproj/numaflow-python.git@v0.12.1#subdirectory=packages/pynumaflow"
...
$ uv pip install protobuf==6.31.0
...
$ uv run python -c "import pynumaflow.sinker"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import pynumaflow.sinker
  File "/.../.venv/lib/python3.14/site-packages/pynumaflow/sinker/__init__.py", line 1, in <module>
    from pynumaflow.sinker.async_server import SinkAsyncServer
  File "/.../.venv/lib/python3.14/site-packages/pynumaflow/sinker/async_server.py", line 7, in <module>
    from pynumaflow.sinker.servicer.async_servicer import AsyncSinkServicer
  File "/.../.venv/lib/python3.14/site-packages/pynumaflow/sinker/servicer/async_servicer.py", line 5, in <module>
    from pynumaflow.shared.asynciter import NonBlockingIterator
  File "/.../.venv/lib/python3.14/site-packages/pynumaflow/shared/__init__.py", line 1, in <module>
    from pynumaflow.shared.server import NumaflowServer
  File "/.../.venv/lib/python3.14/site-packages/pynumaflow/shared/server.py", line 32, in <module>
    from pynumaflow.proto.mapper import map_pb2_grpc
  File "/.../.venv/lib/python3.14/site-packages/pynumaflow/proto/mapper/map_pb2_grpc.py", line 7, in <module>
    from pynumaflow.proto.mapper import map_pb2 as pynumaflow_dot_proto_dot_mapper_dot_map__pb2
  File "/.../.venv/lib/python3.14/site-packages/pynumaflow/proto/mapper/map_pb2.py", line 12, in <module>
    _runtime_version.ValidateProtobufRuntimeVersion(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        _runtime_version.Domain.PUBLIC,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        'pynumaflow/proto/mapper/map.proto'
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/.../.venv/lib/python3.14/site-packages/google/protobuf/runtime_version.py", line 113, in ValidateProtobufRuntimeVersion
    _ReportVersionError(
    ~~~~~~~~~~~~~~~~~~~^
        'Detected incompatible Protobuf Gencode/Runtime versions when loading'
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        f' {location}: gencode {gen_version} runtime {version}. Runtime version'
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        f' cannot be older than the linked gencode version. {error_prompt}'
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/.../.venv/lib/python3.14/site-packages/google/protobuf/runtime_version.py", line 50, in _ReportVersionError
    raise VersionError(msg)
google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading pynumaflow/proto/mapper/map.proto: gencode 6.31.1 runtime 6.31.0. Runtime version cannot be older than the linked gencode version. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.

@khneal khneal marked this pull request as draft February 11, 2026 23:46
@khneal khneal force-pushed the fix/gencode_runtime_minimum_version branch 2 times, most recently from 64d78e9 to 0fcd3c5 Compare February 11, 2026 23:48
Signed-off-by: Kevin Neal <Kevin_Neal@intuit.com>
@khneal khneal force-pushed the fix/gencode_runtime_minimum_version branch from 0fcd3c5 to e0be6bf Compare February 11, 2026 23:55
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.00%. Comparing base (5877fa8) to head (e0be6bf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #318   +/-   ##
=======================================
  Coverage   94.00%   94.00%           
=======================================
  Files          66       66           
  Lines        3087     3087           
  Branches      156      156           
=======================================
  Hits         2902     2902           
  Misses        138      138           
  Partials       47       47           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khneal khneal marked this pull request as ready for review February 12, 2026 00:03
Copy link
Member

@vigith vigith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not sure why our grpc server fails with 6.31.0 while 6.31.1 works; as per https://protobuf.dev/support/cross-version-runtime-guarantee/ (except for cpp and rust) they are compatible across minor versions

@BulkBeing, could you please take a look into this?

@khneal
Copy link
Contributor Author

khneal commented Feb 12, 2026

It appears you used 6.31.1 to generate the code, so it requires at least that version of runtime.
From the page you linked:

New Gencode + Old Runtime = Never Allowed

We may add new runtime APIs in any kind of release (Major, Minor, or Patch). Gencode in that release is allowed to use those new APIs. The consequence is that gencode should never be paired with a runtime that predates the protoc and plugin that was used to generate those bindings.

@vigith
Copy link
Member

vigith commented Feb 12, 2026

We use python grpc_tools.protoc to compile proto. We haven't updated those packages (grpcio and grpcio-tools) in a while.

@khneal
Copy link
Contributor Author

khneal commented Feb 13, 2026

I see several files were updated in this PR from "Protobuf Python Version: 4.25.1" to "Protobuf Python Version: 6.31.1":
https://github.com/numaproj/numaflow-python/pull/250/changes#diff-e63ec56ffe8112f354bb57291ab232155bea9ec15e62c6db29aa697c08a092ab

@vigith
Copy link
Member

vigith commented Feb 13, 2026

@kohlisid/@BulkBeing, should we rollback our proto files or go ahead with bumping up protobuf?

@kohlisid
Copy link
Contributor

I think we should bump the proto up @vigith
With newer versions of other libs using grpc, we will see more mistmatches later

@kohlisid kohlisid merged commit a83067c into numaproj:main Feb 13, 2026
13 checks passed
@vigith
Copy link
Member

vigith commented Feb 13, 2026

thank you @khneal, i opened an issue (#319) to catch these in CI

@khneal khneal deleted the fix/gencode_runtime_minimum_version branch February 13, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants