Postgresql service is not being restarted after charms edits pg_hba.conf from adding a juju relation

Bug #1992527 reported by Gustavo Sanchez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
New
Undecided
Unassigned

Bug Description

When adding a juju relation to postgresql charm new information is being added to pg_hba.conf

Example:
./12/main/pg_hba.conf:host "remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "54.157.207.104/24" md5 # db:9 (remote-6dc084ff30ac402b8d9ffdf4e6a94c62/0)
./12/main/pg_hba.conf:host "remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "54.157.207.104/24" md5 # db:9 (remote-6dc084ff30ac402b8d9ffdf4e6a94c62/0)
./12/main/pg_hba.conf:host "remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "3.237.28.105/24" md5 # db:9 (remote-6dc084ff30ac402b8d9ffdf4e6a94c62/0)
./12/main/pg_hba.conf:host "remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "3.237.28.105/24" md5 # db:9 (remote-6dc084ff30ac402b8d9ffdf4e6a94c62/0)
./12/main/pg_hba.conf:host "remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "54.160.201.32/24" md5 # db:9 (remote-6dc084ff30ac402b8d9ffdf4e6a94c62/0)
./12/main/pg_hba.conf:host "remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62" "54.160.201.32/24" md5 # db:9 (remote-6dc084ff30ac402b8d9ffdf4e6a94c62/0)

Note: This is a juju cross model relation.

However, postgresql service is not being restarted after this file is edited. Thus, not allowing related charms to properly connect to the database because of whitelist not being reloaded.

Output of trying to manually connect to postgresql service using psql cli from one of the related charms:

psql -h 3.93.194.50 -U juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62
psql: error: connection to server at "3.93.194.50", port 5432 failed: FATAL: pg_hba.conf rejects connection for host "54.157.207.104", user "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62", database "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62", SSL on
connection to server at "3.93.194.50", port 5432 failed: FATAL: pg_hba.conf rejects connection for host "54.157.207.104", user "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62", database "juju_remote-6dc084ff30ac402b8d9ffdf4e6a94c62", SSL off

A similar behaviour happens after changing postgresql charm configs
Ex. juju config postgresql extra_pg_auth="host all all 0.0.0.0/0 md5"
Information will get rendered inside pg_hba.conf but service would not have been restarted after it.

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.