Unable to destroy model when manually provisioned machine is destroyed before charm

Bug #1795510 reported by Adam Israel
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Incomplete
Low
Joseph Phillips

Bug Description

Version: Juju 2.5-beta1-bionic-amd64 installed via snap edge channel (2.5-beta1+develop-c25711a)

I've launched a LXD container to use with Juju's manual provisioner. When I tear down the model, removing the charm and deleting the container, if the container is stopped before Juju has completed removing the charm, Juju enters a state where the model cannot be destroyed and the application is not removed until I run `remove-machine --force`.

# Steps to recreate:

1. Manually add a machine to juju ala `juju add-machine ssh:user@host`
2. Deploy charm --to $machine (and wait for it to finish)
3. Remove charm
4. Destroy the manually provisioned machine while the charm is still being removed (or destroy the machine before issuing `remove-application`

The model is left in a state where a destroy will not work because it is not empty, and attempts to remove the charm and machine do not work.

I tried `juju remove-application charmnative-vnf-a` and `juju remove-machine 0`, neither of which resolved the model state. Running `juju remove-machine 0 --force`, however, removed the machine and allowed the charm and model to be destroyed.

# Logs and whatnot:

$ juju status
Model Controller Cloud/Region Version SLA Timestamp Notes
default devel localhost/localhost 2.5-beta1 unsupported 17:01:07-04:00 attempt 1 to destroy model failed (will retry): model not empty, found 1 machine, 1 application (model not empty)

App Version Status Scale Charm Store Rev OS Charm version Notes
charmnative-vnf-a active 0/1 native-ci local 0 ubuntu

Unit Workload Agent Machine Public address Ports Message
charmnative-vnf-a/0 unknown lost 0 10.207.192.48 agent lost, see 'juju show-status-log charmnative-vnf-a/0'

Machine State DNS Inst id Series AZ Message
0 down 10.207.192.48 manual:10.207.192.48 xenial Manually provisioned machine

$ juju show-status-log charmnative-vnf-a/0
ERROR no status history available

juju debug-log does not show anything from the period after I ran `juju remove-application`

Revision history for this message
Joseph Phillips (manadart) wrote :

What command are you issuing to achieve "3. Destroy model"?

Regarding "4. Destroy the manually provisioned machine...", is this removing/stopping the container via lxc?

Changed in juju:
status: New → Incomplete
assignee: nobody → Joseph Phillips (manadart)
Revision history for this message
Adam Israel (aisrael) wrote :

Sorry, step 3 should have been "remove application".

WRT step 4, it is stopping the lxd container. Once the container is unavailable, the charm removal fails.

description: updated
Revision history for this message
Joseph Phillips (manadart) wrote :

This looks like what we expect.

Removing the application requires that the unit agents running on the machine(s) run appropriate hooks for removal and notify the controller that they are done.

If the machine is stopped before this is complete, the controller never gets this confirmation and indeed cannot progress through the other standard teardown workflows.

So forcing is the only alternative, which gets the job done here.

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Undecided → Low
tags: added: expirebugs-bot
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.