Failed removing a subordinate unit

I’m trying to remove a subordinate unit, but that is not allowed?

juju remove-unit prometheus-node-exporter/0
removing unit prometheus-node-exporter/0 failed: unit "prometheus-node-exporter/0" is a subordinate

The subordinates are linked to the principle units. You cannot remove only 1 subordinate unit. To remove the subordinates use juju remove-relation

Perhaps the error message could be more helpful?

Something like: "removing unit xxx/0 failed: unit “xx/0” is related, remove the relation to remove it.

https://github.com/juju/juju/pull/14012

1 Like

Beautiful and helpful. This matters!