Skip to content

Patroni no longer works due to a floating dependency problem

Summary

An upgrade to the latest security release breaks Patroni. The customer reported affected version is 16.8.6 but also impact other versions such as 16.10.x.

The ydiff library got upgraded to 1.3 from 1.2, but it broke patronictl:

 File "/opt/gitlab/embedded/bin/patronictl", line 5, in <module>
        from patroni.ctl import ctl
      File "/opt/gitlab/embedded/lib/python3.9/site-packages/patroni/ctl.py", line 33, in <module>
        from cdiff import markup_to_pager, PatchStream
    ModuleNotFoundError: No module named 'cdiff'

Initial review has determined: https://github.com/zalando/patroni/blob/422047f1051909d72757f2bb13f9ff02cbfa4b63/requirements.txt#L15 allows any version of ydiff above 1.2.0, but as described in https://github.com/zalando/patroni/blob/634b44ee0586f063033074806a42b534a354cbff/docs/releases.rst#L16 ydiff 1.3 requires the cdiff module.

Steps to reproduce

The following MR has confirmed the issue and should address the issue.

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs

Relevant logs

Details of package version

Provide the package version installation details

Workaround

Overwrite the ydiff 1.3 version with 1.2:

curl -o /opt/gitlab/embedded/lib/python3.9/site-packages/ydiff.py https://raw.githubusercontent.com/ymattw/ydiff/1.2/ydiff.py
Edited by Stan Hu