Provide a way to clean up dead controllers / models from cache.yaml

Bug #1553059 reported by Charles Butler
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Mick Gregg

Bug Description

juju 2.0-beta-1

When attempting to kill a controller listed in `juju list-controllers` - a controller showed up which was shared with me by a colleague from the new juju model sharing feature.

When I attempted to kill this controller however, things didn't go so swimmingly

ubuntu@dev:~$ juju kill-controller mbruzek
ERROR "mbruzek" is not a controller; use juju model destroy to destroy it
ubuntu@dev:~$ juju model destroy mbruzek
ERROR unrecognized command: juju model

The help output seems to want to read `juju destroy-model mbruzek` But that didn't yield' good results either

ubuntu@dev:~$ juju destroy-model mbruzek
ERROR cannot read model info: model "amazon:mbruzek" not found
ubuntu@dev:~$ juju destroy-model mbruzek:mbruzek
WARNING! This command will destroy the "mbruzek" model.
This includes all machines, services, data and other resources.

Continue [y/N]? y
ERROR cannot connect to API: refreshing models: current account for controller mbruzek not found

The controller is long since gone, and i'm unable to forcibly remove this model from my workspace. To fully remove it i had to go into the juju config innards, and remove it from the cache.yaml file.

Seems like we may need to add some cleanup or kill-model should be a thing to forcibly remove these crufty bits.

Revision history for this message
Cheryl Jennings (cherylj) wrote :

I can correct the suggestion to use "juju model destroy" to reference the real command, "juju destroy-model".

I agree that we need a mechanism for cleaning up the cache file. I have run into this issue myself a few times. I believe there was discussion about this before, but I don't know that any plans were actually made around it.

Changed in juju-core:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.0-beta3
tags: added: destroy-model juju-release-support
Revision history for this message
Cheryl Jennings (cherylj) wrote :
summary: - Help output when killing a `shared model` is incorrect
+ Provide a way to clean up dead controllers / models from cache.yaml
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta3 → 2.0-beta4
tags: added: 2.0-count
Revision history for this message
Andrew Wilkins (axwalk) wrote :

I suggest we add a new command, "juju purge-controller", which removes all information about the controller from the client. I'll raise this on the list.

Changed in juju-core:
milestone: 2.0-beta4 → 2.1.0
tags: added: usability
Changed in juju-core:
assignee: nobody → Cheryl Jennings (cherylj)
Changed in juju-core:
milestone: 2.1.0 → 2.0-beta9
Changed in juju-core:
assignee: Cheryl Jennings (cherylj) → Mick Gregg (macgreagoir)
Mick Gregg (macgreagoir)
Changed in juju-core:
status: Triaged → In Progress
Revision history for this message
Mick Gregg (macgreagoir) wrote :
Mick Gregg (macgreagoir)
Changed in juju-core:
importance: High → Critical
tags: added: blocker
Mick Gregg (macgreagoir)
tags: removed: blocker
Changed in juju-core:
importance: Critical → High
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta9 → none
milestone: none → 2.0-beta9
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.