Skip to content

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

Closed

Description

@mverboom

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

Activity

  1. bugy commented on Dec 16, 2022

    @bugy
    Owner

    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

  2. mverboom commented on Dec 16, 2022

    @mverboom
    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

  3. bugy commented on Dec 16, 2022

    @bugy
    Owner

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

  4. mverboom commented on Dec 16, 2022

    @mverboom
    Author

    Hi,

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

    Thanks!!

    Mark

  5. added a commit that references this issue on Jan 7, 2023
  6. added this to the 1.18.0 milestone on Jan 7, 2023
  7. bugy commented on Jan 7, 2023

    @bugy
    Owner

    Fixed in dev version

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions