canonical / canonical/postgresql-operator

`connectivity: "off"` put the charm in a strange state where pg_hba was broken

Open
#1,839 2 comments 1 reaction 1 assignee Claimed by @marceloneppel View on GitHub
bug
Dominant language
Python
Stars
20
Forks
36
Avg merge
4d 15h
Merged PRs (30d)
30

Description

## Steps to reproduce

1. I believe a backup operation on the primary during the upgrade process turned `connectivity: "off"` in `juju show-unit postgresql/{0,1} --endpoint database-peers`.
2. This caused `pg_hba` to not be updated with the relation access and postgres units to not be able to communicate with each other.

## Expected behavior
The easiest would probably be to block certain juju actions during upgrades.

## Actual behavior

## Versions

Operating system:

Juju CLI:

Juju agent:

Charm revision:

LXD:

## Log output

Juju debug log:

```
unit-kteam-postgresql-0: 2026-07-08 19:07:28 INFO juju.worker.uniter.relation unknown relation 52 resolving next op
unit-kteam-postgresql-0: 2026-07-08 19:06:36 ERROR unit.kteam-postgresql/0.juju-log Failed to list PostgreSQL database users: connection to server at "10.141.120.77", port 5432 failed: FATAL: pg_hba.conf rejects connection for host "10.141.120.216", user "operator", database "postgres", no encryption

unit-kteam-postgresql-0: 2026-07-08 19:06:38 ERROR unit.kteam-postgresql/0.juju-log Failed to list PostgreSQL database access groups: connection to server at "10.141.120.77", port 5432 failed: FATAL: pg_hba.conf rejects connection for host "10.141.120.216", user "operator", database "postgres", no encryption
```

## Additional context

MM thread: https://chat.canonical.com/canonical/pl/998sfwp6xp8h3mjj66hd16u81w

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.