How to resolve "ERROR machine is already provisioned" in manual provision set up?

I set up a manually provisioned environment successfully (in local network among x3 12.04 ubuntu servers.) However adding the second machine failed twice. After the third try (installed missing dependency) their remained x2 'pending' machines.

I tried destroy-machines on those, than used destroy-environment to try and start over. Now when I add machine I get:

ERROR machine is already provisioned.

I have tried uninstalling/re-installing along with removing all juju files in ~/.juju.

Any ideas on how to start over or remove the provisioning?

Thanks!


Per documentation on https://jujucharms.com/docs/stable/clouds-manual:

Note: If you have an existing configuration, you can use juju generate-config --show to output the new config file, then copy and paste relevant areas in a text editor etc.

On each failing node:

sudo rm -rf /etc/init/juju*
sudo rm -rf /var/lib/juju

Now kill all Juju processes and run

sudo apt-get remove juju-mongodb landscape-common
sudo rm -rf /var/lib/juju
sudo rm -rf /usr/lib/juju
sudo rm /tmp/pprof.jujud.* /usr/bin/juju-run
sudo rm -r /etc/juju

This will allow a normal add-machine.


Ubuntu 18.04 with juju 2.6.8

Clean up the machine-node.

sudo rm -rf /var/lib/juju
sudo rm -rf /lib/systemd/system/juju*
sudo rm -rf /run/systemd/units/invocation:juju*
sudo rm -rf /etc/systemd/system/juju*

Also, for newer systemd based distros: rm /etc/systemd/system/jujud*