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

"Protobuf gencode version" warning #201

Closed
mateenkasim opened this issue Sep 10, 2024 · 2 comments
Closed

"Protobuf gencode version" warning #201

mateenkasim opened this issue Sep 10, 2024 · 2 comments

Comments

@mateenkasim
Copy link
Contributor

Just bumped from 0.16.0 to 0.18.1, and I'm getting these warnings now, looks like fallout from #191.

/.venv/lib64/python3.11/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at authzed/api/v1/core.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(
/.venv/lib64/python3.11/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at authzed/api/v1/error_reason.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(
/.venv/lib64/python3.11/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at authzed/api/v1/experimental_service.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(
/.venv/lib64/python3.11/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at authzed/api/v1/permission_service.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(
/.venv/lib64/python3.11/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at authzed/api/v1/debug.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(
/.venv/lib64/python3.11/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at authzed/api/v1/schema_service.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(
/.venv/lib64/python3.11/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at authzed/api/v1/watch_service.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(

I don't think there's a real breaking change, so I'm just gonna filter the warning out, but it seemed worth noting.

@tstirrat15
Copy link
Contributor

tstirrat15 commented Sep 10, 2024

Hmm... This test should theoretically catch that. Gencode being older than runtime code should also be generally okay, as long as semver boundaries aren't being crossed. On the other hand, we set a pretty broad range for the protobuf lib, so it might be that your dependency resolution is selecting something higher than what was used to generate the code.

I think the intended use case is that the version of protobuf used to generate the code is the same as the version used to run the code. I think the vision is that anyone consuming a gRPC service is doing their own code generation, so us doing the generation and providing the lib is breaking that expectation somewhat. We also don't want to be too prescriptive as library authors and provide too narrow a dependency range that then breaks someone's usage who needs a different version of protobuf for whatever reason.

I think the fix for you in the meantime would be to explicitly put protobuf==5.27.3 into your dependency management file. I can add that to an FAQ or something if that ends up working.

@mateenkasim
Copy link
Contributor Author

mateenkasim commented Sep 11, 2024

I hear you, and I agree with you that the dependency range should be broad. After some digging, it turns out this is a new warning as of protobuf==5.28.0, so I'm gonna close this issue as they hash this one out.

Honestly, I don't think it's uncommon for a product to provide the gRPC client to its customers, so this warning is a little weird, especially for a minor version difference. If I happened to use two different gRPC clients in one project, chances are slim that they'd match protobuf gencode versions perfectly. For now though, filtering the warning or locking the protobuf version both work well for me.

Thanks for the feedback!

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

No branches or pull requests

2 participants