debug-hooks doesn't accept a named action

Bug #1640242 reported by Adam Israel
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Wishlist
Anastasia

Bug Description

Version: Juju 2.0.x

The `debug-hooks` command does not work if an action is named, similar to a hook, i.e.,:

$ juju debug-hooks netutils/1 dig
ERROR unit "netutils/1" does not contain hook "dig"

Naturally, this is because dig is an action, not a hook, but actions run in a similar context. If I were to simply run:

$ juju debug-hooks netutils/1

and in a different terminal:
$ juju run-action netutils/1 dig

The debug-hooks session opens in the context of the action, where the action can be debugged. This is an ugly workaround, though, because by hooking all events in the charm, you may have to cycle through the queue of hooks (update-status, config-changed, leader-elect, etc) before the action is run. This leads to a poor developer experience.

I propose two possible solutions:

a) allow the debug-hooks command to accept a hook name
or
b) add a debug-actions command that works similar to debug-hooks but only accepts action names.

Changed in juju:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

Note that this _is_ documented as a working feature:

https://jujucharms.com/docs/stable/developer-debugging

```
To debug actions, you use the same command, like this:

juju debug-hooks <service/unit> [action-name action-name2 ...]
For example, if you want to check the add-repo action of a the git charm, use:

juju debug-hooks git/0 add-repo
Learn more about actions in Juju actions.
```

Please update the docs to remove that feature, if this is truly a "wishlist" item.

Changed in juju:
assignee: nobody → Anastasia (anastasia-macmood)
Revision history for this message
Anastasia (anastasia-macmood) wrote :
Changed in juju:
status: Triaged → In Progress
Changed in juju:
status: In Progress → Fix Committed
milestone: none → 2.3-rc1
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.

Other bug subscribers

Remote bug watches

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