Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I managed to delete my Juju client cofiguration without running a juju destroy-environment first, leaving my MaaS in a state where I could not deploy to it.

I would get the following (conflicting) output

$ juju bootstrap
ERROR environment is already bootstrapped
$ juju status
ERROR Unable to connect to environment "".
Please check your credentials or use 'juju bootstrap' to create a new environment.

Error details:
no instances found

So, I tried running juju destroy-environment with the new config, to see if it would clean up the old Juju environment on the MaaS system. It gave me the error "ERROR gomaasapi: got error back from server: 409 CONFLICT".

I went into the MaaS GUI and stopped the leftover machines, and then deleted all the nodes and had then go through the discovery and commissioning stages again, but I still got the same errors after all that!

Is there a way to reset this?

share|improve this question
up vote 3 down vote accepted

Deleting/clearing/recommissioning nodes will not clear out old Juju settings. This is because MaaS stores files, some of them including the Juju bootstrapped state.

To reset this, you need to run:

maas-cli login root http://<your_MaaS_server_hostname>/MAAS/
maas-cli root files list

This will list the files that have been stored on the MaaS server by Juju. See if any of the files listed have the filename bootstrap-verify or provider-state. If so, run the following commands to remove the files and reset the MaaS to being in an "Non bootstrapped" state:

maas-cli root file delete bootstrap-verify
maas-cli root file delete provider-state

Run juju status. If it gives you an error that indicates it is not bootstrapped, simply run juju bootstrap and you should be good to go. If it gives some other error indicating that it thinks it's deployed but can't find a file or something, then remove the folder ~/.juju/environments/ (maybe back it up just in case), and then run juju bootstrap.

(See the IRC logs where I found the solution.)

share|improve this answer
I get inavlid choice u'root' when running the above commands, maas-cli must have changed its input format. – tommed Feb 10 '14 at 17:05
IIRC, I think that the new format just means you can leave out root on the second command, as it lets you leave the username out once you are logged in. – Azendale Mar 10 '14 at 22:38

in Ubuntu 14.04Lts with Openstack IceHouse I've resolved that removing the directory "enviroments" and "ssh" inside the path .juju/

rm .juju/environments
rm .juju/ssh

and re-launch the commands

$: juju sync-tools -e maas
$: juju bootstrap --upload-tools -e maas --debug
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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