Your message dated Thu, 24 Mar 2022 14:48:03 +0100
with message-id <[email protected]>
and subject line Re: Bug#1003292: Unpassworded superuser account now causes 
errors in log
has caused the Debian Bug report #1003292,
regarding Unpassworded superuser account now causes errors in log
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1003292: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003292
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: patroni
Version: 2.1.2-2

I actually encountered this problem in the PGDG package of Patroni for Ubuntu (version 2.1.2-2.pgdg18.04+1), but it claims to be an unchanged rebuild of Debian release 2.1.2-2, so I expect this is the best place to report problems.

In /etc/patroni/config.yml.in, which is added by the Debian packaging, there's this section:

# A superuser role is required in order for Patroni to manage the local
# Postgres instance.  If the option `use_unix_socket' is set to `true', then
# specifying an empty password results in no md5 password for the superuser
# being set and sockets being used for authentication. The `password:' line is
# nevertheless required.  Note that pg_rewind will not work if no md5 password
# is set.
    superuser:
      username: "postgres"
      password:

That to me implies that not setting a superuser password should work as long as I have use_unix_socket set to true and use_pg_rewind set to false, both of which I do. And up to Patroni 2.1.1 it did. With the upgrade to 2.1.2, Patroni still seems to work correctly but it produces log messages like this every ten seconds:

Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]: 2022-01-07 
17:51:09,869 ERROR: Exception when working with leader
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]: Traceback (most recent 
call last):
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File 
"/usr/lib/python3/dist-packages/patroni/postgresql/rewind.py", line 60, in 
check_leader_is_not_in_recovery
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     with 
get_connection_cursor(connect_timeout=3, options='-c statement_timeout=2000', 
**conn_kwargs) as cur:
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File 
"/usr/lib/python3.8/contextlib.py", line 113, in __enter__
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     return 
next(self.gen)
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File 
"/usr/lib/python3/dist-packages/patroni/postgresql/connection.py", line 44, in 
get_connection_cursor
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     conn = 
psycopg.connect(**kwargs)
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File 
"/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 127, in connect
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     conn = 
_connect(dsn, connection_factory=connection_factory, **kwasync)
Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]: psycopg2.OperationalError: 
connection to server at "172.28.208.196", port 5432 failed: fe_sendauth: no 
password supplied

It looks like Patroni now wants to connect to other nodes as a superuser even when use_pg_rewind is false.

I haven't managed to find anywhere in the upstream Patroni documentation that says that running with no password on the superuser account should work, so I think this is probably an error in the comment in config.yml.in rather than a bug in Patroni itself.

--
Ben Harris, University of Cambridge Information Services.

--- End Message ---
--- Begin Message ---
Version: 2.1.3-1

Hi,

Am Freitag, dem 07.01.2022 um 18:01 +0000 schrieb Ben Harris:
> Package: patroni
> Version: 2.1.2-2
> 
> I actually encountered this problem in the PGDG package of Patroni
> for Ubuntu (version 2.1.2-2.pgdg18.04+1), but it claims to be an
> unchanged rebuild of Debian release 2.1.2-2, so I expect this is the
> best place to report problems.

That's fine, I just missed your mail, sorry.


> In /etc/patroni/config.yml.in, which is added by the Debian
> packaging, 
> there's this section:
> 
> # A superuser role is required in order for Patroni to manage the
> local
> # Postgres instance.  If the option `use_unix_socket' is set to
> `true', then
> # specifying an empty password results in no md5 password for the
> superuser
> # being set and sockets being used for authentication. The
> `password:' line is
> # nevertheless required.  Note that pg_rewind will not work if no md5
> password
> # is set.
>      superuser:
>        username: "postgres"
>        password:
> 
> That to me implies that not setting a superuser password should work
> as long as I have use_unix_socket set to true and use_pg_rewind set
> to false, both of which I do.  And up to Patroni 2.1.1 it did.  With
> the upgrade to 2.1.2, Patroni still seems to work correctly but it
> produces log messages like this every ten seconds:
> 
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]: 2022-01-07
> 17:51:09,869 ERROR: Exception when working with leader
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]: Traceback
> (most recent call last):
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File
> "/usr/lib/python3/dist-packages/patroni/postgresql/rewind.py", line
> 60, in check_leader_is_not_in_recovery
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     with
> get_connection_cursor(connect_timeout=3, options='-c
> statement_timeout=2000', **conn_kwargs) as cur:
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File
> "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     return
> next(self.gen)
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File
> "/usr/lib/python3/dist-packages/patroni/postgresql/connection.py",
> line 44, in get_connection_cursor
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     conn =
> psycopg.connect(**kwargs)
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:   File
> "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 127, in
> connect
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:     conn =
> _connect(dsn, connection_factory=connection_factory, **kwasync)
> Jan  7 17:51:09 moa-dev-patroni1 patroni@13-main[10646]:
> psycopg2.OperationalError: connection to server at "172.28.208.196",
> port 5432 failed: fe_sendauth: no password supplied
> 
> It looks like Patroni now wants to connect to other nodes as a
> superuser even when use_pg_rewind is false.

I had reported that problem here and it got fixed in 2.1.3:
https://github.com/zalando/patroni/issues/2162

Let me know if you still see this problem.


Michael

-- 
Michael Banck
Teamleiter PostgreSQL-Team
Projektleiter
Tel.: +49 2166 9901-171
E-Mail: [email protected]

credativ GmbH, HRB Mönchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Geoff Richardson, Peter Lilley

Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen: https://www.credativ.de/datenschutz

--- End Message ---

Reply via email to