juju destroy-environment destroys other environments

Bug #1257481 reported by Aaron Bentley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
John A Meinel
1.16
Fix Released
High
John A Meinel
juju-core (Ubuntu)
Fix Released
Undecided
Unassigned
Saucy
Won't Fix
Undecided
Unassigned

Bug Description

[Impact]
Users inadvertently destroy all environments that they own, not just the target one.

[Test Case]
juju bootstrap env1
juju bootstrap env2
juju destroy-environement env1
# both environments destroyed

[Regression Potential
Minimal, the fix tightens up the pattern match used to determine which machines to destroy.

[Original Bug Report]
I destroyed my "juju-ci" environment, and my "juju-ci-2" environment was also deleted. The environments had unique control-buckets.

$ juju destroy-environment -e juju-ci
WARNING: this command will destroy the "juju-ci" environment (type: openstack)
This includes all machines, services, data and other resources.

Continue [y/N]? y
$ juju status
ERROR Unable to connect to environment "juju-ci-2".
Please check your credentials or use 'juju bootstrap' to create a new environment.

Error details:
no instances found

Related branches

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1257481] [NEW] juju destroy-environment destroys other environments

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-12-04 1:17, Aaron Bentley wrote:
> Public bug reported:
>
> I destroyed my "juju-ci" environment, and my "juju-ci-2"
> environment was also deleted. The environments had unique
> control-buckets.
>
> $ juju destroy-environment -e juju-ci WARNING: this command will
> destroy the "juju-ci" environment (type: openstack) This includes
> all machines, services, data and other resources.
>
> Continue [y/N]? y $ juju status ERROR Unable to connect to
> environment "juju-ci-2". Please check your credentials or use 'juju
> bootstrap' to create a new environment.
>
> Error details: no instances found

I'm pretty sure we do a prefix match, and "juju-ci-machine-0" and
"juju-ci-2-machine-0" both match "juju-ci-". Probably we could force
the next bits and you'd only hit it if you did "juju-ci-machine" as
the other environment name.

I'm not 100% sure on that.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKfIUEACgkQJdeBCYSNAAO/RACgpAQIB0XOytaMr7FPm/ep16bP
YR8AoJHoiBTkXB0d/i4e32qQjBx6xiHr
=/ElA
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote :

Not actually critical (not a regression) as it has been the case since we implemented the openstack provider, but I'll see if we can at least do a bit better about our filtering.

Changed in juju-core:
assignee: nobody → John A Meinel (jameinel)
importance: Critical → High
status: Triaged → In Progress
Revision history for this message
Aaron Bentley (abentley) wrote :

I marked it critical because it is a way that users can accidentally destroy a production environment, which is what happened to me. It claims to be destroying one environment and then destroys another. Tremendously dangerous, and obviously no workaround exists, because once the environment is deleted, it's gone for good, including any unique data that may have been in that environment.

John A Meinel (jameinel)
Changed in juju-core:
milestone: none → 1.17.0
Go Bot (go-bot)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
James Page (james-page)
Changed in juju-core (Ubuntu):
status: New → Fix Released
James Page (james-page)
description: updated
Revision history for this message
Rolf Leggewie (r0lf) wrote :

saucy has seen the end of its life and is no longer receiving any updates. Marking the saucy task for this ticket as "Won't Fix".

Changed in juju-core (Ubuntu Saucy):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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