bootstrap without a jenv destroys an existing environment

Bug #1336843 reported by Jay R. Wren
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Medium
Katherine Cox-Buday

Bug Description

Easy to reproduce:

1. create a new environment
2. bootstrap it
3. remove the environments/name.jenv
4. bootstrap it again
5. instead of getting an "exists" message, you get a destroying message.

Use case for why this is bad:

Team Member A creates an environment for production and shares it with Team Member B (or all team for maintenance), by sharing the environment section of environments.yaml file, and keys and certificate files if needed.

Team Member B adds the environment to .juju/environments.yaml file and put the keys and certificates into files if needed.

Team Member B runs bootstrap, not realizing it already exists.

The production environment is destroyed.

Example output attached.

Tags: bootstrap
Revision history for this message
Jay R. Wren (evarlast) wrote :
Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
tags: added: bootstrap
Ian Booth (wallyworld)
Changed in juju-core:
milestone: none → 1.21-alpha1
assignee: nobody → Katherine Cox-Buday (cox-katherine-e)
Changed in juju-core:
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.21-alpha1 → 1.21-alpha2
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Revision history for this message
Francesco Banconi (frankban) wrote :

Using 1.21-alpha2 the environment is no longer destroyed, but a new one is still created and no "environment already exists" message is displayed. See below.

~ % juju version
1.21-alpha2-utopic-amd64
~ % juju bootstrap -e ec2 --upload-tools
Bootstrapping environment "ec2"
Starting new instance for initial state server
Launching instance
 - i-68b9b32a
Building tools to upload (1.21-alpha2.1-trusty-amd64)
Installing Juju agent on bootstrap instance
Waiting for address
Attempting to connect to ec2-54-73-27-206.eu-west-1.compute.amazonaws.com:22
Attempting to connect to ip-10-89-138-68.eu-west-1.compute.internal:22
Attempting to connect to 54.73.27.206:22
Attempting to connect to 10.89.138.68:22
Warning: Permanently added 'ec2-54-73-27-206.eu-west-1.compute.amazonaws.com,54.73.27.206' (ECDSA) to the list of known hosts.
Logging to /var/log/cloud-init-output.log on remote host
Running apt-get update
Running apt-get upgrade
Installing package: curl
Installing package: cpu-checker
Installing package: bridge-utils
Installing package: rsyslog-gnutls
Bootstrapping Juju machine agent
Starting Juju machine agent (jujud-machine-0)
Bootstrap complete
~ % juju status -e ec2
environment: ec2
machines:
  "0":
    agent-state: started
    agent-version: 1.21-alpha2.1
    dns-name: ec2-54-73-27-206.eu-west-1.compute.amazonaws.com
    instance-id: i-68b9b32a
    instance-state: running
    series: trusty
    hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M
    state-server-member-status: has-vote
services: {}
~ % rm ~/.juju/environments/ec2.jenv
~ % juju bootstrap -e ec2 --upload-tools
Bootstrapping environment "ec2"
Starting new instance for initial state server
Launching instance
 - i-601c3e85
Building tools to upload (1.21-alpha2.1-trusty-amd64)
Installing Juju agent on bootstrap instance
Waiting for address
Attempting to connect to ec2-54-170-170-10.eu-west-1.compute.amazonaws.com:22
Attempting to connect to ip-10-72-159-254.eu-west-1.compute.internal:22
Attempting to connect to 54.170.170.10:22
Attempting to connect to 10.72.159.254:22
Warning: Permanently added 'ec2-54-170-170-10.eu-west-1.compute.amazonaws.com,54.170.170.10' (ECDSA) to the list of known hosts.
Logging to /var/log/cloud-init-output.log on remote host
Running apt-get update
Running apt-get upgrade
Installing package: curl
Installing package: cpu-checker
Installing package: bridge-utils
Installing package: rsyslog-gnutls
Bootstrapping Juju machine agent
Starting Juju machine agent (jujud-machine-0)
Bootstrap complete
WARNING expected one instance, got 2

At this point two EC2 instances are up and running.

Revision history for this message
Richard Harding (rharding) wrote :

Francesco, I'd suggest we raise this as a new bug on juju-core since this has landed and is due to be part of the release. I suggest we track this and we can raise the question on if this is a potential release blocker for the 1.21 release.

Revision history for this message
Francesco Banconi (frankban) wrote :

Food point Rick: filed bug 1386703.

Revision history for this message
Francesco Banconi (frankban) wrote :

Good point even...

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.