Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiselect error: Invalid parameter <param> value: hal value '<value>', but should be in [] #606

Open
mverboom opened this issue Dec 16, 2022 · 5 comments

Comments

@mverboom
Copy link

Hi,

Not 100% sure if my configuration is valid, however it seems to work find as long as I don't select anything on the multiselect :)

The main configuration file is:

{
  "name": "test",
  "script_path": "ls",
  "output_format": "terminal",
  "include": "test.inc",
  "parameters": [
    {
      "name": "dir",
      "required": true,
      "default": "/tmp",
      "constant": true
    }
  ]
}

The included file is:

{
  "hidden": true,
  "parameters": [
    {
      "name": "Files",
      "type": "multiselect",
      "values": {
        "script": "ls ${dir}"
      },
      "multiselect_argument_type": "argument_per_value"
    }
  ]
}

The multiselect is populated, and works as expected. However, selecting an option results in an error. For example, selecting the item call results in:

Calling the script...

Invalid parameter Files value: has value 'call', but should be in []

And the same in the logs:

2022-12-16 11:46:55,295 [web_server.ERROR] Invalid parameter Files value: has value 'call', but should be in []
2022-12-16 11:46:55,296 [tornado.access.WARNING] 400 POST /executions/start (192.168.1.55) 15.99ms

Is this configuration invalid, or am I running into a bug?

Regards,

Mark

@bugy
Copy link
Owner

bugy commented Dec 16, 2022

Hi @mverboom this could be a bug. Could you try a couple of things:

  1. Remove "constant" flag
  2. Do ls /tmp directly instead of using ${dir}

This is just to help me to understand the reason. I believe I never tested included file with dependant parameters

@bugy bugy added the bug label Dec 16, 2022
@mverboom
Copy link
Author

Hi,

I did the tests.

  1. Removing the "constant" flag resolves the error message!
  2. Changing to ls /tmp (with constant back enabled), also fixes this

The way I am trying to use this is to have a main script which is very short and defines a constant. The constant is used by the main command and the script option to populate the multiselect that is in the include file. This way, I can have multiple configurations, without having to duplicate the code.

The constant flag was an option I used to prevent the parameter from being visible to the user. I can at least use the removal of this to get the setup working.
The second workaround (not using the variable) is not an option as that breaks the include (it will not be generic anymore).

I hope this makes sense.

Is it possible to make this work with the constant option enabled?

Regards,

Mark

@bugy
Copy link
Owner

bugy commented Dec 16, 2022

Hi @mverboom thanks for the feedback, I can have a look, but cannot promise any quick solution here.

@mverboom
Copy link
Author

Hi,

Thanks! No hurry here now I have a workaround with the removal of the constant option :)

Thanks!!

Mark

@bugy bugy added this to the 1.18.0 milestone Jan 7, 2023
@bugy bugy added the resolved label Jan 7, 2023
@bugy
Copy link
Owner

bugy commented Jan 7, 2023

Fixed in dev version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants