Debugging actions, any documentation?

I’m trying to debug a charm action for my nextcloud charm.

How to debug is referred to here in the docs: Juju - The simplest way to deploy and maintain applications in the cloud

Following the docs don’t help me much.

The documentation just say “run debug-hooks” but I’m faced with a serious uphill:

  • I don’t even know where to start given the documentation. The documentation is extremely thin here.
  • In the documentation link above, it references Debugging charm hooks which doesn’t cover debugging actions at all.
  • When my action fails, I get the most cryptic error message which leads me nowhere.

$ juju run-action nextcloud/0 maintenance mod=“on” --wait
ERROR validation failed: (root).mod : must be of type string, given true

Debugging … anyone that has a better description on how I can debug my action than the documentation provides?

Wow, it doesn’t take long to find edge cases. The error is caused by Juju (I think?) parsing the argument as YAML. The string “no” evaluates to false (the authors of YAML were not from Norway!).

Perhaps try using a different value for now. I will try to answer the question about debugging when I have a little more time

The value = on. No “no”.

But I can confirm that it’s working when setting the value to something else. But this must be a bug?

1 Like

Ah, my mistake. As it happens, “on” is also a valid Boolean value. The full list is:

 y|Y|yes|Yes|YES|n|N|no|No|NO
|true|True|TRUE|false|False|FALSE
|on|On|ON|off|Off|OFF
1 Like

Ping @wallyworld. Do you know where that validation message is being generated from? Is the client parsing the argument as YAML?

I think this is rudimentary and the dreaded juju ERROR gives me no hint on whats going on.

Should I file a bug?

Yes, please. That way a fix can be tracked.

I’ve submitted a bug: Bug #1880846 “Running juju action with specific values gives ERR...” : Bugs : juju

1 Like

I’ve also proposed a feature for situations similar to this Bug #1881049 “Feature add config and action parameter type: set” : Bugs : juju