Local provider isn't usable after an old environment has been destroyed

Bug #1238541 reported by Björn Tillenius
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
golxc
Fix Committed
High
Patrick Hetu
juju-core
Fix Released
High
Ian Booth

Bug Description

I would expect that when using the local provider, if I do 'sudo juju destroy-environment',
I can create a new local environment using 'sudo juju bootstrap'. But it doesn't seem
that works.

Let's say that I do some testing with a local provider, and I decide to start over, so I
do "sudo juju destroy-environment"

Now when I do "sudo juju bootstrap", the bootstrap itself doesn't return any error,
but looking at "juju status" after I've deployed a new service I see this:

environment: local
machines:
  "0":
    agent-state: started
    agent-version: 1.15.1.1
    dns-name: 10.0.3.1
    instance-id: localhost
    series: saucy
  "1":
    agent-state-info: '(error: container "bjorn-local-machine-1" is already created)'
    instance-id: pending
    series: precise
services:
  mysql:
    charm: cs:precise/mysql-27
    exposed: false
    relations:
      cluster:
      - mysql
    units:
      mysql/0:
        agent-state: pending
        machine: "1"

Ok, so I have to manually remove the containers, using lxc-destroy. However, that also
isn't enough, now after a new bootstrap and deploy I see this:
machines:
  "0":
    agent-state: started
    agent-version: 1.15.1.1
    dns-name: 10.0.3.1
    instance-id: localhost
    series: saucy
  "1":
    agent-state-info: '(error: symlink /var/lib/lxc/bjorn-local-machine-1/config /etc/lxc/auto/bjorn-local-machine-1.conf:
      file exists)'
    instance-id: pending
    series: precise
services:
  mysql:
    charm: cs:precise/mysql-27
    exposed: false
    relations:
      cluster:
      - mysql
    units:
      mysql/0:
        agent-state: pending
        machine: "1"

Related branches

summary: - Local provider can't bootstrap after an old environment has been
- destroyed
+ Local provider isn't usable after an old environment has been destroyed
Revision history for this message
Curtis Hovey (sinzui) wrote :

I have seen this while testing. I cannot reliably succeed or fail.

tags: added: local-provider
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
tags: added: intermittent-failure
Revision history for this message
Geoff Teale (tealeg) wrote :

I'm seeing this too.

Curtis Hovey (sinzui)
Changed in juju-core:
milestone: none → 2.0
Revision history for this message
Patrick Hetu (patrick-hetu) wrote :

It's an error in the lxc-info output parsing in the golxc package that cause this bug.

The output of lxc-info with lxc version 1.0 alpha is something like this:

Name: myusername-local-machine-1
State: RUNNING
PID: 15925
IP: 10.0.3.22

and the code that parse it is this:

    out, err := run("lxc-info", "-n", c.name)
    if err != nil {
        return StateUnknown, -1, err
    }
    kv := keyValues(out, ": ")
    state := State(kv["state"])
    pid, err := strconv.Atoi(kv["pid"])

Note that "state" and "pid" are lower case. So I think the best way to fix
that without breaking anything else is to convert the keys to lower case in the keyValues function.
I've attached a patch that does that.

affects: juju-core → golxc
Changed in golxc:
milestone: 2.0 → none
status: Triaged → New
Revision history for this message
John A Meinel (jameinel) wrote :

sounds like a reasonable patch to me. Can you propose it from a bzr branch?

Nate Finch (natefinch)
Changed in golxc:
status: New → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
milestone: none → 1.17.1
Ian Booth (wallyworld)
Changed in golxc:
assignee: nobody → Patrick Hetu (patrick-hetu)
Changed in juju-core:
assignee: nobody → Ian Booth (wallyworld)
status: Triaged → In Progress
Ian Booth (wallyworld)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.