etcd3 package incompatible with protobuf 4.x

Bug #1980079 reported by Stephen Finucane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tooz
Confirmed
Medium
Stephen Finucane

Bug Description

This isn't so much an issue with tooz as with the etcd3 dependency. The etcd3-based tests are currently failing with the following error message:

    Failed to import test module: tooz.tests.drivers.test_etcd3
    Traceback (most recent call last):
      File "/usr/lib/python3.7/unittest/loader.py", line 436, in _find_test_path
        module = self._get_module_from_name(name)
      File "/usr/lib/python3.7/unittest/loader.py", line 377, in _get_module_from_name
        __import__(name)
      File "/home/zuul/src/opendev.org/openstack/tooz/tooz/tests/drivers/test_etcd3.py", line 22, in <module>
        import tooz.drivers.etcd3 as etcd3_driver
      File "/home/zuul/src/opendev.org/openstack/tooz/tooz/drivers/etcd3.py", line 18, in <module>
        import etcd3
      File "/home/zuul/src/opendev.org/openstack/tooz/.tox/py37/lib/python3.7/site-packages/etcd3/__init__.py", line 3, in <module>
        import etcd3.etcdrpc as etcdrpc
      File "/home/zuul/src/opendev.org/openstack/tooz/.tox/py37/lib/python3.7/site-packages/etcd3/etcdrpc/__init__.py", line 1, in <module>
        from .rpc_pb2 import *
      File "/home/zuul/src/opendev.org/openstack/tooz/.tox/py37/lib/python3.7/site-packages/etcd3/etcdrpc/rpc_pb2.py", line 16, in <module>
        from etcd3.etcdrpc import kv_pb2 as kv__pb2
      File "/home/zuul/src/opendev.org/openstack/tooz/.tox/py37/lib/python3.7/site-packages/etcd3/etcdrpc/kv_pb2.py", line 36, in <module>
        type=None),
      File "/home/zuul/src/opendev.org/openstack/tooz/.tox/py37/lib/python3.7/site-packages/google/protobuf/descriptor.py", line 755, in __new__
        _message.Message._CheckCalledFromGeneratedFile()
    TypeError: Descriptors cannot not be created directly.
    If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
    If you cannot immediately regenerate your protos, some other possible workarounds are:
     1. Downgrade the protobuf package to 3.20.x or lower.
     2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

Clearly something needs to be fixed in etcd3 itself but etcd3 is unmaintained [1] and the driver itself has been deprecated in tooz [2][3]. We probably want to cap protobuf<4.0 until we can finally remove this driver.

[1] https://github.com/kragniz/python-etcd3/issues/1719
[2] http://lists.openstack.org/pipermail/openstack-discuss/2022-March/027664.html
[3] https://review.opendev.org/c/openstack/tooz/+/833107

Changed in python-tooz:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Stephen Finucane (stephenfinucane)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.