# Issues with actions and config-panel features

**URL:** https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773
**Category:** Core dev
**Tags:** english
**Created:** [December 9, 2019, 12:16pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773 "2019-12-09T12:16:58Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [December 9, 2019, 12:16pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/1 "2019-12-09T12:16:59Z")

</div>

Sorry Aleks that I got rid of the template, it does not apply here.

So @Bram @Bram @Bram @Bram @Bram @Bram @Bram @Bram, if I can’t summon you that way, I don’t know how to do it…

Here the issues I have with config-panel and actions.  
Considering I’m only using the admin panel, that’s the purpose of those features.

- There’s no log of what 's going on. Looks like we still have stderr, but not stdout and the info output.
- Arguments in an action does not print properly, I only have a checkbox.
- ~~The default values aren’t from the values read into the files. But only the default values as set into the toml file.~~
- And more importantly since it breaks fallback\_ynh’s config-panel entirely, there’s a laconic error saying:

```auto
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py", line 439, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 527, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/log.py", line 287, in func_wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/moulinette/yunohost/app.py", line 1824, in app_config_show_panel
    config_panel = _get_app_config_panel(app)
  File "/usr/lib/moulinette/yunohost/app.py", line 2163, in _get_app_config_panel
    option["ask"] = {"en": option["ask"]}
KeyError: 'ask'

```

just because it doesn’t allow sub entry like:

```auto
[main]
name = "Fallback configuration"

    [main.main_server]
    name = "Fallback, main server configuration"

        [main.main_server.encryption]
        name = "Encryption"

            [main.main_server.encryption.encrypt]
            ask = "Do you want to encrypt your backups ?"
            type = "boolean"
            default = true

```

It works only with:

```auto
[main]
name = "Fallback configuration"

    [main.main_server]
    name = "Fallback, main server configuration"

# [main.main_server.encryption]
# name = "Encryption"

# [main.main_server.encryption.encrypt]
            [main.main_server.encrypt]
            ask = "Do you want to encrypt your backups ?"
            type = "boolean"
            default = true

```

Which change completely the shape of the menu, as well as all the variables used by the script.

* * *

toml files used for those test were [https://github.com/YunoHost-Apps/fallback\_ynh/blob/master/config\_panel.toml](https://github.com/YunoHost-Apps/fallback_ynh/blob/master/config_panel.toml) and [https://github.com/YunoHost-Apps/etherpad\_mypads\_ynh/blob/testing/config\_panel.toml](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/blob/testing/config_panel.toml).  
For the action, especially with arguments, it’s this one [https://github.com/YunoHost-Apps/etherpad\_mypads\_ynh/blob/testing/actions.toml](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/blob/testing/actions.toml)

It could as well be because of a misconfiguration or a syntax change that I didn’t heard about yet.  
One way or the other, could be nice to go forward of these features.

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [December 24, 2019, 12:17pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/2 "2019-12-24T12:17:03Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [December 28, 2019, 12:47pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/3 "2019-12-28T12:47:12Z")

</div>



---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [December 28, 2019, 12:47pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/4 "2019-12-28T12:47:41Z")

</div>

Bump @Bram 😓

---

<div class="post-metadata">

### Author: ![Bram](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bram/32/388_2.png) [@Bram](https://forum.yunohost.org/u/Bram)
#### Post date: [December 29, 2019, 2:37pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/5 "2019-12-29T14:37:56Z")

</div>

Ah oupsi, gonna look at that \>.\>

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [January 4, 2020, 6:41pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/6 "2020-01-04T18:41:54Z")

</div>

> [@Maniack\_Crudelis](#):
>
> The default values aren’t from the values read into the files. But only the default values as set into the toml file.

Using `ynh_return` instead of `echo` in the `config` script solve that issue.  
Forgot that change and didn’t update all my script at that time. It will be done now.

The other errors are still relevant though.

---

<div class="post-metadata">

### Author: ![Gofannon](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/g/50afbb/32.png) [@Gofannon](https://forum.yunohost.org/u/Gofannon)
#### Post date: [January 24, 2020, 4:33pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/7 "2020-01-24T16:33:51Z")

</div>

Do you mind sharing working examples scripts?  
Is it plan to add this to the “example\_ynh”? I can create a dedicated branch for it and create a PR to discuss about it.

Also, is there some “documentation draft” or a location with information about this feature somewhere? I’am thinking of something like [https://github.com/YunoHost/doc/blob/group-and-permissions/groups\_and\_permissions.md](https://github.com/YunoHost/doc/blob/group-and-permissions/groups_and_permissions.md)

As my server is now running YunoHost 3.7, I get complain with new group permission and cannot really test the config-panel functionality

---

<div class="post-metadata">

### Author: ![Kayou](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kayou/32/1972_2.png) [@Kayou](https://forum.yunohost.org/u/Kayou)
#### Post date: [January 26, 2020, 2:19pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/8 "2020-01-26T14:19:12Z")

</div>

We will add it to example\_ynh when this feature is considered stable.

@Maniack_Crudelis is this [config panel](https://github.com/YunoHost-Apps/fallback_ynh/blob/2-different-panels/config_panel.toml) looks good for you?

Moreover, I’ve added

```auto
ynh_script_progression --message="Super message"

```

in the `apply_config` function, and I get this log, so I don’t understand your first point?

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [January 29, 2020, 11:28am UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/9 "2020-01-29T11:28:04Z")

</div>

Having a quick look to your config\_panel, you removed a sub entry into the menu.  
So yes for sure it works that way, but you just bypassed the error.

That for sure I could find a way to change the menu and make it works without a sub entry. But it feels like it would be better to fix the issue.

> [@Kayou](#):
>
> in the `apply_config` function, and I get this log, so I don’t understand your first point?

Not sure, but I think I was talking about actions, not config. Did you try it as well ?

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [January 29, 2020, 11:30am UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/10 "2020-01-29T11:30:14Z")

</div>

> [@Gofannon](#):
>
> Do you mind sharing working examples scripts?  
> Is it plan to add this to the “example\_ynh”? I can create a dedicated branch for it and create a PR to discuss about it.

Yes, I’ve plan to do that. But, as the feature isn’t yet stable, I rather prefer to keep it for me for now.  
Still you can find some examples in my apps.

As soon as it will be ready, I planned to add all my works about it into the example app. But for now, it’s changing quite often.

---

<div class="post-metadata">

### Author: ![Kayou](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kayou/32/1972_2.png) [@Kayou](https://forum.yunohost.org/u/Kayou)
#### Post date: [January 29, 2020, 2:04pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/11 "2020-01-29T14:04:47Z")

</div>

I just removed

```auto
[main]
name = "Fallback configuration"

```

For me it’s not supposed to change anything?

Moreover, the panel looks like [the json one](https://github.com/YunoHost-Apps/fallback_ynh/blob/bde776613f72d3f851f6f86e766a5559c28ba684/config_panel.json).

I may not understand everything here, but what is the role of the “main” section?

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [January 29, 2020, 8:24pm UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/12 "2020-01-29T20:24:35Z")

</div>

I don’t know if the main section is needed or not. But what if you add another layer ?  
If the issue is about the number of layer, then there’s an error somewhere as we didn’t have this limitation before.  
If it’s only about the main, ok we can get rid of it.

What’s for sure is that removing the “main” section removes one layer to the menu.

---

<div class="post-metadata">

### Author: ![Gofannon](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/g/50afbb/32.png) [@Gofannon](https://forum.yunohost.org/u/Gofannon)
#### Post date: [January 30, 2020, 9:48am UTC](https://forum.yunohost.org/t/issues-with-actions-and-config-panel-features/9773/13 "2020-01-30T09:48:35Z")

</div>

Thanks for this, I will avoid to spend too much time on this then.
