destroying the current model should clear the current-model

Bug #1505504 reported by Richard Harding
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Critical
Andrew Wilkins

Bug Description

Created several environments, switched among them, and then destroyed the current one.

I get the error:

ERROR environment "spark" not found

A grep finds:

grep spark .juju/**/*
.juju/current-environment:spark

Attempts to switch over fail:

juju system use-env website-analytics
ERROR environment "spark" not found

I manually edited the current-environment file to read 'website-analytics' and then the 'juju system environments' command works properly.

Ubuntu 1.26alpha1

Curtis Hovey (sinzui)
tags: added: destroy-environment
Revision history for this message
Cheryl Jennings (cherylj) wrote :

In your example, if you've already got the connection details for env 'website-analytics' (through creating the environment yourself, or through a prior use-env command), you can use juju switch and you can work around this issue.

Destroying the current environment should probably put us back into the system context for whatever system was hosting the environment that was just destroyed.

Changed in juju-core:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Richard Harding (rharding) wrote :

Defaulting to admin seems like it might not be best as our goal is to not have folks interact with that environment. I wonder if it'd be best to either have some sort of 'no current environment selected' state or if it should be historically based?

Thinking that through, if it's historically based you'd still run into the same issue. If I go in and destroy many of the environments in there I'd end up not having a good fallback to go to.

Revision history for this message
Cheryl Jennings (cherylj) wrote :

Destroying the current model should probably put you back to just operating on the controller (i.e. clear the current model)

summary: - error when destroying current environment in a multi-environment
- scenario
+ destroying the current model should clear the current-model
tags: added: juju-release-support usability
Changed in juju-core:
milestone: none → 2.0-beta8
Andrew Wilkins (axwalk)
Changed in juju-core:
status: Triaged → In Progress
assignee: nobody → Andrew Wilkins (axwalk)
Revision history for this message
Andrew Wilkins (axwalk) wrote :

We've been clearing the current model for a while now, but we've still been printing out an ugly/invalid error message that states there's no current controller. I've got a PR that will change this to correctly state that there's no current model, and how you can go about setting one.

$ juju status
ERROR no model specified

There is no current model specified for the current controller,
and none specified on the command line. Please use "juju switch"
to set the current model, or specify a model on the command line
using the "-m" flag.

Revision history for this message
Richard Harding (rharding) wrote : Re: [Bug 1505504] Re: destroying the current model should clear the current-model

+1 ty andrew

On Wed, May 25, 2016 at 12:01 AM Andrew Wilkins <
<email address hidden>> wrote:

> We've been clearing the current model for a while now, but we've still
> been printing out an ugly/invalid error message that states there's no
> current controller. I've got a PR that will change this to correctly
> state that there's no current model, and how you can go about setting
> one.
>
> $ juju status
> ERROR no model specified
>
> There is no current model specified for the current controller,
> and none specified on the command line. Please use "juju switch"
> to set the current model, or specify a model on the command line
> using the "-m" flag.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1505504
>
> Title:
> destroying the current model should clear the current-model
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju-core/+bug/1505504/+subscriptions
>

Andrew Wilkins (axwalk)
Changed in juju-core:
importance: High → Critical
tags: added: blocker
Andrew Wilkins (axwalk)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: removed: blocker
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta8 → none
milestone: none → 2.0-beta8
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.