JuJu fails installing a unit (Failure: exceptions.KeyError: 'JUJU_ENV_UUID')

Bug #1212146 reported by David Fischer on 2013-08-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyjuju
Undecided
Unassigned

Bug Description

First thing first, thank you all to make such great FLOSS softwares !

I am deploying my own set of charms into a cluster handled by Canonical MAAS.
I want to deploy two services (charms) into the same physical machine, thanks to juju-jitsu I can do it with the deploy-to method.

The deployment of the 1st service was successful and I waited until this services is successfully installed to deploy the 2nd one (as I known that install hooks can fight for resources, e.g. apt-get). ... And then, juju failed.

Desktop
--------------

juju 0.7 (from PPA) running on Ubuntu 13.04 amd64.
$ uname -a
Linux TECW7W02-Ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Server n°0
-----------------

$ juju ssh 0
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-51-generic x86_64)
$ uname -a
Linux nnqrp 3.2.0-51-generic #77-Ubuntu SMP Wed Jul 24 20:18:19 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Part of the debug-log
-----------------------------------

$ juju debug-log
(... bootstrap and setup of 1st service ...)
2013-08-14 10:05:02,028 Machine:0: juju.agents.machine DEBUG: Units changed old:set(['orchestra/0']) new:set(['webui/0', 'orchestra/0'])
2013-08-14 10:05:02,028 Machine:0: juju.agents.machine DEBUG: Starting service unit: webui/0 ...
2013-08-14 10:05:02,077 Machine:0: unit.deploy DEBUG: Downloading charm local:precise/oscied-webui-5 to /var/lib/juju/charms
2013-08-14 10:05:03,591 Machine:0: unit.deploy DEBUG: Using <juju.machine.unit.UnitMachineDeployment object at 0x2b229d0> for webui/0 in /var/lib/juju
2013-08-14 10:05:03,591 Machine:0: unit.deploy DEBUG: Starting service unit webui/0...
2013-08-14 10:05:04,056 unit:webui/0: hook.executor DEBUG: started
2013-08-14 10:05:04,062 unit:webui/0: statemachine DEBUG: unitworkflowstate: transition install (None -> installed) {}
2013-08-14 10:05:04,062 unit:webui/0: statemachine DEBUG: unitworkflowstate: execute action do_install
2013-08-14 10:05:04,077 unit:webui/0: hook.output DEBUG: Cached relation hook contexts: []
2013-08-14 10:05:04,081 unit:webui/0: hook.executor DEBUG: Running hook: /var/lib/juju/units/webui-0/charm/hooks/install
2013-08-14 10:05:04,082 unit:webui/0: hook.executor DEBUG: Hook error: /var/lib/juju/units/webui-0/charm/hooks/install 'JUJU_ENV_UUID'
2013-08-14 10:05:04,082 unit:webui/0: twisted ERROR: Unhandled error in Deferred:
2013-08-14 10:05:04,083 unit:webui/0: twisted ERROR: Unhandled Error
Traceback (most recent call last):
Failure: exceptions.KeyError: 'JUJU_ENV_UUID'

2013-08-14 10:05:04,215 Machine:0: unit.deploy INFO: Started service unit webui/0

The status
-----------------

$ juju status
2013-08-14 10:17:48,034 INFO Connecting to environment...
2013-08-14 10:17:48,833 INFO Connected to environment.
machines:
  0:
    agent-state: running
    dns-name: nnqrp.master
    instance-id: /MAAS/api/1.0/nodes/node-f439fcfc-0421-11e3-97e2-080027b25b70/
    instance-state: unknown
services:
  orchestra:
    charm: local:precise/oscied-orchestra-9
    exposed: true
    relations: {}
    units:
      orchestra/0:
        agent-state: started
        machine: 0
        open-ports:
        - 5000/tcp
        - 27017/tcp
        - 5672/tcp
        public-address: nnqrp.master
  webui:
    charm: local:precise/oscied-webui-5
    exposed: true
    relations: {}
    units:
      webui/0:
        agent-state: pending
        machine: 0
        open-ports: []
        public-address: nnqrp.master
2013-08-14 10:17:48,916 INFO 'status' command finished successfully

Kapil Thangavelu (hazmat) wrote :

we recommend people use juju-core instead of pyjuju at this time for new deployments, pyjuju isn't under active development. the issue your having is due to divergence of the environment juju version and the version the charm depends on. To resolve with pyjuju you'll need to enable the juju-origin: ppa setting on the environments.yaml

Yes, environments.yaml is configured with the juju-origin: ppa. I will avoid merging my service into machine 0 (juju instance) and re-check if it does work better.

Thanks indeed.

OK, now I use juju-core, thanks. You can close this ticket if I not find how to do it ;-)

Do not use old juju, that is the rule.

Changed in juju:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers