relating with telegraf doesn't work

Bug #1893225 reported by Junien F
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
Triaged
High
Unassigned

Bug Description

Ubuntu 20.04, charm version 206.

Relating postgresql:db-admin with telegraf:postgresql doesn't work.
There's a mistmatch between the connstr and the pg_hba entry.

$ juju run --unit telegraf/0 "relation-get -r postgresql:10 - postgresql/2"
allowed-subnets: 10.2.3.4/32
egress-subnets: 10.2.3.4/32
host: 127.0.1.1
master: dbname=telegraf host=127.0.1.1 password=<REDACTED> port=5432 user=jujuadmin_telegraf
[...]

^ postgresql gives 127.0.1.1 in the relation

postgresql/0 $ sudo grep telegraf /etc/postgresql/12/main/pg_hba.conf
host all all "10.2.3.4/32" md5 # db-admin:10 (telegraf/0)

^ but in the pg_hba file, it uses the actual IP

leading to the constant logging of the following on the unit :
2020-08-27T14:01:30Z E! [inputs.postgresql_extensible] FATAL: pg_hba.conf rejects connection for host "127.0.0.1", user "jujuadmin_telegraf", database "telegraf", SSL off (SQLSTATE 28000)

The charm should add the same IP it sends in the connstr to pg_hba.conf

Thanks

Revision history for this message
Stuart Bishop (stub) wrote :

pg_hba.conf should contain the egress addresses of the clients, taken from the relation. It is quite possible that subordinates do not supply this information (since they are cohosted), and the PostgreSQL charm needs to cope with that.

Changed in postgresql-charm:
status: New → Triaged
importance: Undecided → High
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.