You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self.unit.status is a BlockedStatusobject, while S3_BLOCK_MESSAGES is a list of strings. A BlockedStatus object will never equal a plain string, so this not in check is always True. The intended S3 block message exclusion never fires.
Affected branches
main — bug exists at src/charm.py line 1755
16/edge — needs verification (likely same bug if the line exists)
Impact
The _on_update_status method always early-exits when the charm is in any blocked state, including S3-related blocked states that should allow continued processing (e.g., retrying stanza initialization when S3 settings are fixed).
Fix
Change self.unit.status to self.unit.status.message:
The same bug existed in the K8s charm (canonical/postgresql-k8s-operator) on its main branch and is being fixed by PR Fix substrate #1243 (branch include-pgbackrest-error-details), which switches to is_s3_block_message(self.unit.status.message).
Inside backups.py on both charms, the comparison is done correctly using .message (e.g., self.charm.unit.status.message not in S3_BLOCK_MESSAGES). The bug is only in charm.py.
Problem
In
src/charm.pyon themainbranch (line 1755), there is a comparison:self.unit.statusis aBlockedStatusobject, whileS3_BLOCK_MESSAGESis a list of strings. ABlockedStatusobject will never equal a plain string, so thisnot incheck is always True. The intended S3 block message exclusion never fires.Affected branches
main— bug exists atsrc/charm.pyline 175516/edge— needs verification (likely same bug if the line exists)Impact
The
_on_update_statusmethod always early-exits when the charm is in any blocked state, including S3-related blocked states that should allow continued processing (e.g., retrying stanza initialization when S3 settings are fixed).Fix
Change
self.unit.statustoself.unit.status.message:Notes
canonical/postgresql-k8s-operator) on itsmainbranch and is being fixed by PR Fix substrate #1243 (branchinclude-pgbackrest-error-details), which switches tois_s3_block_message(self.unit.status.message).backups.pyon both charms, the comparison is done correctly using.message(e.g.,self.charm.unit.status.message not in S3_BLOCK_MESSAGES). The bug is only incharm.py.