model teardown fails if a charm is trying to spin up storage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
High
|
Simon Richardson |
Bug Description
If you deploy a charm with attached storage, and then immediately remove the model (before the charm can reach a steady state), the model will fail to teardown, and get stuck indefinitely
```
$ juju add-model foo
Added 'foo' model on localhost/localhost with credential 'localhost' for user 'admin'
$ juju deploy ubuntu
Located charm "ubuntu" in charm-hub, revision 22
Deploying "ubuntu" from charm-hub charm "ubuntu", revision 22 in channel stable on ubuntu@20.04/stable
$ juju destroy-model --no-prompt --destroy-storage foo
Destroying model
Waiting for model to be removed, 1 machine(s), 1 application(s), 1 filesystems(s)...
Waiting for model to be removed, 1 machine(s), 1 application(
.......
.......
.......
# gets stuck here forever
```
This has been causing failures in our CI. The storage part is essential - this issue is not seen with revision 21 of the ubuntu charm, which doesn't include storage. I hypothesise that because we destroy it before it's fully created, the storage is ending up in a weird intermediate state which blocks teardown of the model.
Observed on multiple versions of Juju (2.9, 3.0, 3.1, 3.2), on LXD and AWS.
I wonder if this has anything to do with the changes to storage provisioning that Simon worked on.