canonical / canonical/postgresql-k8s-operator
Postgresql-k8s unit goes to blocked state: `Cannot disable plugins: Existing objects depend on it`
- Dominant language
- Python
- Stars
- 15
- Forks
- 33
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 37
Description
## Steps to reproduce
This only happens once per couple of test runs, hence is difficult to reproduce, but you can do so by running:
```
git clone https://github.com/canonical/iam-bundle.git
tox -e integration -- --keep-models
```
## Expected behavior
Postgresql-k8s app and unit get active.
## Actual behavior
At times `postgresql-k8s` unit gets stuck in blocked state, causing our bundle tests to fail. These are runs from this week:
https://github.com/canonical/iam-bundle/actions/runs/10880493814/job/30244416338#step:4:667
https://github.com/canonical/iam-bundle/actions/runs/10937282732/job/30362792991
https://github.com/canonical/iam-bundle/actions/runs/10900084647/job/30246933947
```
postgresql-k8s/0 [idle] blocked: Cannot disable plugins: Existing objects depend on it. See logs
```
However, we don't enable or disable any plugins in the charms integrated with the database (kratos and hydra). Could you advise what could be causing this?
## Versions
Operating system: ubuntu 22.04
Juju CLI: 3.4/stable
Juju agent: 3.4.5
Charm revision: 381
microk8s: 1.27 and 1.28/stable
## Log output
Juju debug log:
https://github.com/canonical/iam-bundle/actions/runs/10880493814/job/30244416338#step:14:1
## Additional context
We've been deploying postgresql-k8s from `14/stable` channel. So far the tests run successfully when it pointed to rev281, we're experiencing this flaky issue since it was promoted to rev381.
Contributor guide
Research direction
Start with the integration command `tox -e integration -- --keep-models` and the linked Juju debug log, then compare behavior between charm revisions 281 and 381. Trace the intermittent `Cannot disable plugins` state in the PostgreSQL-k8s unit and verify that the integration runs leave the app and unit active without blocked failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, postgresql, python
- Domain
- databases, infrastructure, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100