juju-2.0 has no way to cancel an action

Bug #1588092 reported by Brad Marshall
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Eric Claude Jones

Bug Description

There doesn't appear to be any way to cancel an action in juju-2.0.

I got myself into a state where juju-2.0 had actions pending that would never run. This happened when I got bitten by LP#1537585, the only fix I found was to juju destroy-unit on the failing lxc. Once that happens, the next time I did a juju run on all services it would hang, seemingly trying to connect to the unit which I had destroyed.

Regardless, there should be a UI for removing a action from the queue, there could be other reasons why you don't want them in there.

Also, the help for juju run-action refers to commands that don't exist to do this, specifically:

"Queue an Action for execution on a given unit, with a given set of params.
Displays the ID of the Action for use with 'juju kill', 'juju status', etc."

I couldn't find any evidence of there being a juju kill command.

This occured with juju 2.0-beta7.

Please let me know if you need any further information.

Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Command to cancel an action could be useful. We'd need to consider what to do in both cases - for actions that do have a unit and for actions that are orphaned (unit is dead).

This bug will focus on means of canceling an action.
I am breaking out the help into a separate bug: https://bugs.launchpad.net/juju-core/+bug/1588095

affects: juju-core → juju
Revision history for this message
Felipe Reyes (freyes) wrote :

In 2.0 "juju run" doesn't rely in SSH anymore, it leverages actions to run commands and collect their output, this approach raised the issue described in bug 1647798 , so now we have actions stuck in pending state that will be run once the node comes back online, something that it won't necessarily be desired, as it may happen way in the future.

The lack of a command to remove those actions in pending state doesn't give to the users a way to prevent this.

tags: added: sts
Revision history for this message
Stuart Bishop (stub) wrote :

Similarly, a 'juju run' command that will never complete will block other hooks or commands from being run. Try 'juju run --service foo "tail -f /var/log/syslog"' and Ctrl-C. Fix is to manually ssh into the units and identify and terminate the commands.

tags: added: canonical-is
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Putting up the Importance and allocating to milestone due to feedback from Interested Parties \o/

There is an API to cancel an action but not CLI command: https://github.com/juju/juju/blob/staging/api/action/client.go#L87

Changed in juju:
milestone: none → 2.2.0
importance: Medium → High
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.2-beta1 → 2.2-beta2
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.2-beta2 → 2.2-beta3
Tim Penhey (thumper)
tags: added: talisman
Changed in juju:
assignee: nobody → Eric Claude Jones (ecjones)
Changed in juju:
milestone: 2.2-beta3 → 2.2-beta4
Revision history for this message
Anastasia (anastasia-macmood) wrote :

PR against develop (2.2): https://github.com/juju/juju/pull/7299

Changed in juju:
status: Triaged → In Progress
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
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.