I have machines running on MaaS using Juju. Some of them failed to deploy because a hook didn't run because of an (invalid) setting I set in the config. In the Jju UI, I tried marking them as resolved, and then trying to remove them (and repeated through a few cycles of them going green and and then red).

(I believe doing resolve + remove will make juju not get stuck on the fact that the hook didn't work, and let juju just get rid of the machine.)

Now I have units that seem stuck and say

    agent-state: error
    agent-state-info: 'hook failed: "install"'
    life: dying

in juju status. I've tried destroying the units and the machines they are on. Is there any way to just give up on those units and recycle the machines the are on for another try?

I also tried marking the units resolved on the command line, but I'm getting conflicting messages. I get ERROR cannot set resolved mode for unit "ceph-osd/1": already resolved when I tried to mark it resolved, but status says the same error message above after that when I run juju status

    agent-state: error
    agent-state-info: 'hook failed: "install"'
    life: dying

Update: I just came back after an hour or two, and found that one of the units I was having trouble with went away. So, waiting did work.


The only way I've found to kill them (fast) is destroying the environment.

juju destroy-environment

Of course, since rebuilding the environment from the ground up could be rather drastic, I would suggest waiting for a while before doing this. Sometimes, it just takes a while for all the hooks finish executing and then hopefully the service should no longer be stuck in a dying state. Note that to actually free up the machine, after you have destroyed the unit (juju destroy-unit) you need to run the juju destroy-machine (with the machine number) to release it. Note that juju destroy-machine will not terminate a machine that is currently acting as a unit, so it will not release a unit if it is currently in the dying state.

I presume you were starting to build your environment. It would be helpful to check the log files of the machines (I also check them but not to find why they don't die but rather why they didn't complete).


I had same problem, here is solution:

1) Restart Node in MAAS
2) Charms will go to error state
3) juju resolved " your unit"
4) juju destroy-service " your service"
it worked for me!


Backup Juju's database before you deploy a service. If things go wrong and you can't fix it, just restore Juju from the backup db.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.