Comment 3 for bug 1854893

Revision history for this message
Hua Zhang (zhhuabj) wrote :

I hit the same error in juju 2.8, actually I have deleted 1 machine and 1 volume, but it still says there is when running 'juju destroy-model' with --force option

$ juju destroy-model ssl-queens --force -y
Destroying model
Waiting for model to be removed, 1 machine(s), 1 volume(s)........^Cctrl+c detected, aborting...

$ juju destroy-model ssl-queens --force --no-wait --destroy-storage -y
Destroying model
Waiting for model to be removed, 1 machine(s), 1 volume(s)......^Cctrl+c detected, aborting...

$ juju version
2.8.6-focal-amd64

$ juju show-model ssl-queens |grep life -A 12
  life: dying
  status:
    current: destroying
    message: 'attempt 23 to destroy model failed (will retry): model not empty, found
      1 machine, 1 volume (model not empty)'
    since: "2020-11-26"
  users:
    admin:
      display-name: admin
      access: admin
      last-connection: 2 minutes ago
  sla: unsupported
  agent-version: 2.8.5

Here are logs from controllers

2020-11-27 08:13:28 WARNING juju.state cleanup.go:212 cleanup failed in model e9932e84-9288-423f-8223-54582e823299 for machine("8"): machine 8 has attachments [volume-0]
2020-11-27 08:13:28 WARNING juju.state cleanup.go:212 cleanup failed in model e9932e84-9288-423f-8223-54582e823299 for machine("8"): machine 8 has attachments [volume-0]
2020-11-27 08:13:28 WARNING juju.state cleanup.go:212 cleanup failed in model e9932e84-9288-423f-8223-54582e823299 for forceStorage("e9932e84-9288-423f-8223-54582e823299"): removing volume 0: volume is not dead

Here are dirty records from monodb although I have deleted instances and volumes

juju:PRIMARY> db.machines.find({"model-uuid":"e9932e84-9288-423f-8223-54582e823299"},{"volumes": 0})
{ "_id" : "e9932e84-9288-423f-8223-54582e823299:8", "machineid" : "8", "model-uuid" : "e9932e84-9288-423f-8223-54582e823299", "nonce" : "machine-0:19a52aeb-733e-4380-8fa8-4afabfef0903", "series" : "xenial", "containertype" : "", "principals" : [ ], "life" : 1, "jobs" : [ 1 ], "passwordhash" : "YMpZm4yG+8+IrIOU1PE6hTrI", "clean" : false, "force-destroyed" : true, "addresses" : [ { "value" : "10.5.2.155", "addresstype" : "ipv4", "networkscope" : "local-cloud", "origin" : "provider", "spaceid" : "0" } ], "machineaddresses" : [ { "value" : "10.5.2.155", "addresstype" : "ipv4", "networkscope" : "local-cloud", "origin" : "machine" }, { "value" : "252.2.155.1", "addresstype" : "ipv4", "networkscope" : "local-fan", "origin" : "machine" }, { "value" : "127.0.0.1", "addresstype" : "ipv4", "networkscope" : "local-machine", "origin" : "machine" }, { "value" : "::1", "addresstype" : "ipv6", "networkscope" : "local-machine", "origin" : "machine" } ], "preferredpublicaddress" : { "value" : "10.5.2.155", "addresstype" : "ipv4", "networkscope" : "local-cloud", "origin" : "provider", "spaceid" : "0" }, "preferredprivateaddress" : { "value" : "10.5.2.155", "addresstype" : "ipv4", "networkscope" : "local-cloud", "origin" : "provider", "spaceid" : "0" }, "supportedcontainersknown" : true, "txn-revno" : NumberLong(20), "txn-queue" : [ "5fc0a458b3abc8364068ed7c_6b015ea3", "5fc0a731b3abc8364069d2cc_b550ab65", "5fc0a7fab3abc836406a1689_d3b48390", "5fc0b3b6b3abc836406d8755_fdf3c5db", "5fc0b3e0b3abc836406d955b_50106b40", "5fc0b514b3abc802bdc19bc3_253249d2" ], "tools" : { "version" : "2.8.5-xenial-amd64", "url" : "", "size" : NumberLong(0), "sha256" : "" }, "supportedcontainers" : [ "lxd", "kvm" ], "agent-started-at" : ISODate("2020-11-23T03:20:06.172Z") }

juju:PRIMARY> db.volumes.find({"model-uuid":"e9932e84-9288-423f-8223-54582e823299"}).pretty()
{
        "_id" : "e9932e84-9288-423f-8223-54582e823299:0",
        "name" : "0",
        "model-uuid" : "e9932e84-9288-423f-8223-54582e823299",
        "life" : 1,
        "attachmentcount" : 1,
        "txn-revno" : NumberLong(793260),
        "txn-queue" : [
                "5fc0cde4b3abc802bdc87f02_9cf91910"
        ],
        "info" : {
                "size" : NumberLong(51200),
                "pool" : "cinder",
                "volumeid" : "4a26e0ec-301c-4bff-95eb-bfde1245f6f5",
                "persistent" : true
        }
}

I deleted them from mongdb again

juju:PRIMARY> db.machines.remove({"model-uuid":"e9932e84-9288-423f-8223-54582e823299"})
WriteResult({ "nRemoved" : 1 })
juju:PRIMARY> db.machines.find({"model-uuid":"e9932e84-9288-423f-8223-54582e823299"},{"volumes": 0})
juju:PRIMARY> db.volumes.remove({"model-uuid":"e9932e84-9288-423f-8223-54582e823299"})
WriteResult({ "nRemoved" : 1 })

But I still can't remove model with --force flag

$ juju destroy-model ssl-queens --destroy-storage --force --no-wait -y
Destroying model
Waiting for model to be removed.................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................