Skip to content

[Bug]: Detected mismatched Protobuf Gencode/Runtime major versions #187

Closed

Description

@njbrake

What happened?

Upgraded from 0.2.6 to 0.2.7 and got this error.

Found while working on mozilla-ai/any-agent#410

Relevant log output

ImportError while loading conftest '/Users/nbrake/scm/any-agent/tests/conftest.py'.
tests/conftest.py:12: in <module>
    from any_agent.config import AgentFramework
src/any_agent/__init__.py:2: in <module>
    from .frameworks.any_agent import AgentRunError, AnyAgent
src/any_agent/frameworks/any_agent.py:14: in <module>
    from any_agent.tools.wrappers import _wrap_tools
src/any_agent/tools/__init__.py:1: in <module>
    from .a2a import a2a_tool, a2a_tool_async
src/any_agent/tools/a2a.py:17: in <module>
    from a2a.client import A2ACardResolver, A2AClient
.venv/lib/python3.13/site-packages/a2a/client/__init__.py:9: in <module>
    from a2a.client.grpc_client import A2AGrpcClient
.venv/lib/python3.13/site-packages/a2a/client/grpc_client.py:7: in <module>
    from a2a.grpc import a2a_pb2, a2a_pb2_grpc
.venv/lib/python3.13/site-packages/a2a/grpc/a2a_pb2.py:12: in <module>
    _runtime_version.ValidateProtobufRuntimeVersion(
.venv/lib/python3.13/site-packages/google/protobuf/runtime_version.py:106: in ValidateProtobufRuntimeVersion
    _ReportVersionError(
.venv/lib/python3.13/site-packages/google/protobuf/runtime_version.py:50: in _ReportVersionError
    raise VersionError(msg)
E   google.protobuf.runtime_version.VersionError: Detected mismatched Protobuf Gencode/Runtime major versions when loading a2a.proto: gencode 6.31.1 runtime 5.29.5. Same major version is required. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. ak-ag commented on Jun 12, 2025

    @ak-ag

    Refer:
    #185

    VeshRaazThapa:
    It appears that the issue is specific to a2a-sdk version 0.2.6. As a temporary workaround, you can use version 0.2.5 by running the following command:

    uv add "a2a-sdk==0.2.5"

  2. njbrake commented on Jun 12, 2025

    @njbrake
    ContributorAuthor

    Hmm. Is there some sort of other root caus? In my case, it actually is working ok on 0.2.6, but fails when I upgrade to 0.2.7.

    Working fine:
    Image

    Broken:
    Image

  3. rajeshvelicheti commented on Jun 12, 2025

    @rajeshvelicheti
    Contributor

    Upgrading your runtime to match the generator should solve this issue.

    to check your current version,

    pip show protobuf

    To upgrade

    pip install protobuf>=6.31.1

    You could try this in your venv if needed.

  4. added a commit that references this issue on Jun 12, 2025
    ae1c31c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions