I am working with a rather weird issue using MAAS and Juju where after the bootstrap, machine "0" has been successfully created, I cannot deploy any services issuing a simple juju deploy mysql. To give a brief environment overview, I am running MAAS on Ubuntu Server 13.04 with the IP and juju and juju-core are running on the same server. This is all run in a localized test lab too. Issuing a juju status reveals the following:

root@maas:~# juju status
2013-04-30 10:24:32,876 INFO Connecting to environment...
2013-04-30 10:24:33,439 INFO Connected to environment.
    agent-state: not-started
    dns-name: test4.master
    instance-id: /MAAS/api/1.0/nodes/node-ee044686-b100-11e2-9927-52540089abb8/
    instance-state: unknown
    instance-id: pending
    charm: cs:precise/mysql-19
    relations: {}
        agent-state: pending
        machine: 5
        public-address: null
2013-04-30 10:24:33,496 INFO 'status' command finished successfully

The instance remains in a pending state indefinitely and a look at the debug log reveals that a connection is not being made to provision the instance:

2013-04-30 10:27:26,562: juju.agents.provision@ERROR: Cannot get machine list
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/juju/agents/provision.py", line 175, in process_machines
    provider_machines = yield self.provider.get_machines()
ProviderInteractionError: Unexpected ConnectionRefusedError interacting with provider: Connection was refused by other side: 111: Connection refused.

Now since this error is being generated on machine "0" every minute or so, I looked at a tcpdump to try and find out what was happening. After some digging, I came across this at the exact time the error was being logged:

10:27:26.561631 IP > Flags [S], seq 1222093882, win 32792, options [mss 16396,sackOK,TS val 454628 ecr 0,nop,wscale 6], length 0
10:27:26.561651 IP > Flags [R.], seq 0, ack 1222093883, win 0, length 0

Since machine "0" was deployed with MAAS via Juju, I don't think it would be running MAAS as well. To troubleshoot the issue, I created a SSH tunnel on machine "0" listening on port 80 (localhost) to the MAAS server port 80, e.g. 80:MAAS-Server-IP:80. After that, juju status changed to show the new machine out of the pending state:

    agent-state: not-started
    dns-name: test5.master
    instance-id: /MAAS/api/1.0/nodes/node-fe882bb2-b100-11e2-ba1c-52540089abb8/
    instance-state: unknown

All this to say, can someone please help me understand why the deployed machine "0" is attempting a connection to localhost port 80 rather than the MAAS server? Is this due to the fact I am running Juju and MAAS on the same server?


When an environment is bootstrapped, you must pay attention to the hostname in the environments.yaml, as it appears that is what is pushed out to subsequent machines. In my case, I had the server set to http://localhost:80/MAAS, thus causing machine "0", and any other machines for that matter, to attempt to make a connection to localhost and not the IP/hostname of the MAAS server. After destroying my environment, and bootstrapping it again with the server, everything seemed to deploy correctly. This is entirely an oversight on my part.

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.