juju deploy mysql gives me: Failure: exceptions.KeyError: 'JUJU_ENV_UUID'

Asked by Henry Sorensen on 2013-04-05

When trying to deploy a mysql service on a local LXC I get an error: Failure: exceptions.KeyError: 'JUJU_ENV_UUID'

I've not been able to google anything related to this, so any hints would be welcome.

  Thanks.

uname -a
Linux ubuntu 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

dpkg -l juju
ii juju 0.5+bzr531-0ubuntu1.3

dpkg -l lxc
ii lxc 0.7.5-3ubuntu67

DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"

cat .juju/environments.yaml
default: lxc
environments:
  lxc:
    type: local
    admin-secret: 6608267bbd6b447b8c90934167b2a294999
    default-series: precise
    juju-origin: ppa
    data-dir: /home/USER/lxc

2013-04-05 20:09:54,828 INFO Enabling distributed debug log.
2013-04-05 20:09:54,830 INFO Tailing logs - Ctrl-C to stop.
2013-04-05 20:09:30,927 Machine:0: juju.agents.machine DEBUG: Units changed old:set(['mysql/1']) new:set([])
2013-04-05 20:09:30,928 Machine:0: juju.agents.machine DEBUG: Stopping service unit: mysql/1 ...
2013-04-05 20:09:30,928 Machine:0: unit.deploy INFO: Stopping service unit mysql/1...
2013-04-05 20:09:30,928 Machine:0: unit.deploy DEBUG: Destroying container...
2013-04-05 20:09:31,875 Machine:0: unit.deploy INFO: Destroyed container for mysql/1
2013-04-05 20:09:31,875 Machine:0: unit.deploy INFO: Stopped service unit mysql/1
2013-04-05 20:09:41,618 Machine:0: juju.agents.machine DEBUG: Units changed old:set([]) new:set(['mysql/2'])
2013-04-05 20:09:41,619 Machine:0: juju.agents.machine DEBUG: Starting service unit: mysql/2 ...
2013-04-05 20:09:41,665 Machine:0: unit.deploy DEBUG: Downloading charm cs:precise/mysql-16 to /home/cadm/lxc/cadm-lxc/charms
2013-04-05 20:09:41,714 Machine:0: unit.deploy DEBUG: Using <juju.machine.unit.UnitContainerDeployment object at 0x220c710> for mysql/2 in /home/cadm/lxc/cadm-lxc
2013-04-05 20:09:41,726 Machine:0: unit.deploy DEBUG: Starting service unit mysql/2...
2013-04-05 20:09:41,727 Machine:0: unit.deploy INFO: Creating container mysql-2...
2013-04-05 20:09:43,312 Machine:0: unit.deploy INFO: Container created for mysql/2
2013-04-05 20:09:43,336 Machine:0: unit.deploy DEBUG: Charm extracted into container
2013-04-05 20:09:43,345 Machine:0: unit.deploy DEBUG: Starting container...
2013-04-05 20:09:44,392 Machine:0: unit.deploy INFO: Started container for mysql/2
2013-04-05 20:09:44,393 Machine:0: unit.deploy INFO: Started service unit mysql/2
2013-04-05 20:09:46,772 unit:mysql/2: hook.executor DEBUG: started
2013-04-05 20:09:46,788 unit:mysql/2: statemachine DEBUG: unitworkflowstate: transition install (None -> installed) {}
2013-04-05 20:09:46,788 unit:mysql/2: statemachine DEBUG: unitworkflowstate: execute action do_install
2013-04-05 20:09:46,838 unit:mysql/2: hook.output DEBUG: Cached relation hook contexts: []
2013-04-05 20:09:46,876 unit:mysql/2: hook.executor DEBUG: Running hook: /var/lib/juju/units/mysql-2/charm/hooks/install
2013-04-05 20:09:46,877 unit:mysql/2: hook.executor DEBUG: Hook error: /var/lib/juju/units/mysql-2/charm/hooks/install 'JUJU_ENV_UUID'
2013-04-05 20:09:46,878 unit:mysql/2: twisted ERROR: Unhandled error in Deferred:
2013-04-05 20:09:46,878 unit:mysql/2: twisted ERROR: Unhandled Error
Traceback (most recent call last):
Failure: exceptions.KeyError: 'JUJU_ENV_UUID'

juju status
machines:
  0:
    agent-state: running
    dns-name: localhost
    instance-id: local
    instance-state: running
services:
  mysql:
    charm: cs:precise/mysql-16
    relations: {}
    units:
      mysql/2:
        agent-state: pending
        machine: 0
        public-address: 192.168.122.91
2013-04-05 20:25:12,110 INFO 'status' command finished successfully

lxc-ls
USER-lxc-0-template USER-lxc-mysql-2
USER-lxc-mysql-2

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2013-04-05
Last reply:
2013-06-27

Are there any bugs reported? If not, I suggest you report one

Jian Wen (wenjianhn) said : #2

Same error for me. I am not familiar with juju.
Try the following workaround:
Insert env JUJU_ENV_UUID="None" to /etc/init/juju-mysql-*.conf, then `sudo start juju-mysql-*`.
Replace the above * with proper id.

In the lxc instance, you may find its juju version is 0.7+bzr628+bzr631~precise which is different from the
one in your host. I think this is because there is "juju-origin: ppa" in your .juju/environments.yaml.

Jian Wen (wenjianhn) said : #3

Try the following:

sudo add-apt-repository -y ppa:juju/pkgs # for 0.7+bzr628+bzr631~precise
sudo apt-get update
sudo apt-get install -y juju
sudo apt-get install -y lxc apt-cacher-ng libzookeeper-java zookeeper

mkdir -p /tmp/juju-data
mkdir -p ~/.juju

cat > ~/.juju/environments.yaml <<EOF
default: lxc
environments:
  lxc:
    type: local
    control-bucket: juju-a14dfae3830142d9ac23c499395c2785999
    admin-secret: 6608267bbd6b447b8c90934167b2a294999
    default-series: precise
    juju-origin: ppa
    data-dir: /tmp/juju-data
EOF

juju bootstrap

Can you help with this problem?

Provide an answer of your own, or ask Henry Sorensen for more information if necessary.

To post a message you must log in.