Open jeking3 opened 6 years ago
I agree that we can do better with the error message and identifying which input parameters the type error refers to. However, we won't be handling variable data type like the CLI. From the CLI, user can only pass in string and the CLI makes assumption and some extra effort to take care of that for the user. However in workflow, the developer has more tools and control to work with the data, its type, and transformation.
A better error message is a sufficient resolution.
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.
SUMMARY
With an action that takes a parameter of type
array
, I can run the action from the command line and I can even pass a regular string to it, and it seems to figure it out. However if I do the same thing from a workflow (either mistral or orquesta, it doesn't matter, they both fail) and pass a string into an array parameter for an action, things error out badly without a good error message. Improving the error message would be a sufficient remedy; in fact getting the parameter/input field name into the error message would be good too.ISSUE TYPE
STACKSTORM VERSION
st2 3.0dev (3438b7c), on Python 2.7.6 (also happens on 2.9.0)
OS / ENVIRONMENT / INSTALL METHOD
st2-docker
STEPS TO REPRODUCE
Install the pack I made that demonstrates the issue:
Run the action and pass in a string, see that it works even though the input is of type array - this is because the presence of just one argument is still handled as an array:
Now run the
bad_workflow
which attempts to feed the same input from a workflow:and the result:
Do the same thing with
good_workflow
which sends in:and the result:
The workflow log shows:
EXPECTED RESULTS
I expected to either have it "just work" like the direct action run works, or to have it error out with a message indicating the parameter name that was bad, and why it was bad. In this case saying, "not an array" perhaps instead of "malformed string". I guess the command line argument processing is smart enough to convert all instances of value into array members, but this doesn't happen from a workflow.
ACTUAL RESULTS
See steps to reproduce.