We get a lot of random stolon logs on our db, and was wondering if this is a problem or can be safely ignored.
lax [info]checking stolon status
lax [info]keeper is healthy, db is healthy, role: master
lax [info]configuring operator
lax [info]error configuring operator user: can't scan into dest[3]: cannot scan null into *string
Digging into it, this is coming from admin.ListUsers in fly’s postgres-ha repository.
This error is due to one of the users in your database not having a password set!
Here’s how to fix it using psql:
Connect to your DB with psql
Run the query below. This is straight from the ha-postgres repo, the exact same query ha-postgres runs!
select u.usename,
usesuper as superuser,
userepl as repluser,
a.rolpassword as passwordhash,
(
select array_agg(d.datname::text order by d.datname)
from pg_database d
WHERE datistemplate = false
AND has_database_privilege(u.usename, d.datname, 'CONNECT')
) as
allowed_databases
from
pg_user u join pg_authid a on u.usesysid = a.oid
order by u.usename;
Check which of the users does not have a passwordhash set.
Give that user a password by entering \password <username of the user missing a password>
Important! Restart your database fly.io app. I had to restart mine for the changes to be picked up.