charm can block itself if the installation hook fails after installing packages

Bug #1939667 reported by Martin Hilton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
New
Undecided
Unassigned

Bug Description

I have postgresql units deployed that are stuck in a "blocked" state with the message, "
PostgreSQL config from previous install found at /etc/postgresql/12/main". These were fresh machines so there was certainly no previous install on them.

Looking through the unit logs what appears to have happened is that the install hook failed with an unrelated error enabling wal-e:

2021-08-11 16:32:09 WARNING unit.postgresql/3.install logger.go:60 subprocess.CalledProcessError: Command '['/snap/bin/wal-e.envdir', '/etc/postgresql/12/main/wal-e.e
nv', '/snap/bin/wal-e.swift', 'post', '**redacted**']' returned non-zero exit status 1.
2021-08-11 16:32:09 ERROR juju.worker.uniter.operation runhook.go:139 hook "install" (via explicit, bespoke hook script) failed: exit status 1

This appears to have caused the charm to get into a confused state, where it installed the postgresql apt packages, but didn't update its own state to remember that. Then when it attempted to retry the install it found the postgresql data directory that it created an misattributed it to being a previous installation.

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.