Hi,
(I'm not on pgsql-pkg-debian, somebody forwarded me your mail)
On Wed, Apr 27, 2022 at 02:37:34PM +0300, Kirill wrote:
> I am using that package:
>
> $ apt-cache policy patroni
> patroni:
> Installed: 2.1.3-2.pgdg110+1
> Candidate: 2.1.3-2.pgdg110+1
> Version table:
> *** 2.1.3-2.pgdg110+1 500
> 500 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 Packages
> 100 /var/lib/dpkg/status
>
> During the usage of patroni I got an error:
>
> $ patroni --validate-config /etc/patroni-server/config.yaml
[...]
> Traceback (most recent call last):
[...]
> File "/usr/lib/python3/dist-packages/patroni/validator.py", line 244, in iter_dict
> validator = self.validator[key]._schema[d]
> KeyError: 'etcd3'
Apparently, running --validate-config on a config using etc3 has been
broken for quite a long time, and nobody noticed.
> I started to investigate and found that actual file:
>
> $ dpkg -S /usr/lib/python3/dist-packages/patroni/validator.py
> patroni: /usr/lib/python3/dist-packages/patroni/validator.py
>
> is different from source file:
This is because there is a Debian patch that reverts an upstream change
that adds some RAFT tests which (as Debian does not ship RAFT yet) when
run would make the testsuite fail:
https://salsa.debian.org/postgresql/patroni/-/blob/debian/2.1.3-2/debian/patches/regression_tests_disable_raft_tests.py
However, that upstream change we reverted also added etcd3 validation,
which is what is now missing for you.
I've reworked the patch[1] so that only the RAFT-specifc changes remain,
and in my testing the above traceback is gone.
I will upload it once CI passes.
Michael
[1] https://salsa.debian.org/postgresql/patroni/-/commit/538cc5f0f9d6bd1704513f7280a0fd35cd193edf