canonical / canonical/postgresql-operator
S3 backups fail on the non-primary site if cross-site replication is enabled with the error message `Stanza was not initialised`
- Dominant language
- Python
- Stars
- 20
- Forks
- 36
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 30
Description
## Steps to reproduce
1. Set up cross-site replication in postgresql.
2. Set up s3-integrator charm.
3. `juju run -m pgsddev-swarm-a postgresql/0 create-backup` fails on all units in the non-primary postgresql model with a confusing message
```
$ juju run postgresql/0 create-backup
Running operation 71 with 1 task
- task 72 on unit-postgresql-0
Waiting for task 72...
Action id 72 failed: Stanza was not initialised
$ juju run postgresql/1 create-backup
Running operation 73 with 1 task
- task 74 on unit-postgresql-1
Waiting for task 74...
Action id 74 failed: Stanza was not initialised
```
Backups work as expected on the primary site.
## Expected behavior
Either the backups should work or the error message should be clearer if it's not supported.
Also, this results in a number of COS alerts about `PgBackRestBackupTooOld` since the backups don't work.
## Actual behavior
Explained above `Action id xx failed: Stanza was not initialised` on all non-primary-site units.
## Versions
Operating system: Ubuntu 24.04.3 LTS
Juju CLI: 3.5.7-genericlinux-amd64
Juju agent: 3.6.7
Charm revision: 16/stable 952
LXD: 5.21.4 LTS
## Log output
Juju debug log:
```
unit-postgresql-0: 15:25:25 INFO unit.postgresql/0.juju-log backups:A full backup has been requested on unit
unit-postgresql-0: 15:25:25 ERROR unit.postgresql/0.juju-log backups:Backup failed: Stanza was not initialised
```
## Additional context
Contributor guide
Research direction
Reproduce the failure by enabling cross-site replication and the s3-integrator charm, then run the create-backup action on both primary and non-primary PostgreSQL units. Start with the reported Juju debug-log lines and compare backup behavior between sites. Done means backups work on the non-primary site or the action reports a clear, supported limitation instead of `Stanza was not initialised`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, postgresql, python
- Domain
- databases, devops, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100