Skip to content

Conversation

pradnya-orchestral
Copy link
Contributor

@pradnya-orchestral pradnya-orchestral commented Aug 12, 2021

When output value fails schema validation defined in the output schema, the st2web UI does not display the validation error but returns // Action produced no data. The issue here is that the backend writes the error message in the "error" key in the result and the UI is hard coded for local/remote/python runners which expects the error to be under the "stderr" key in the result.

Example output schema in the meta data YAML file:

output_schema:
    osTestParam:
        description: test parameter
        type: string
        required: true
        secret: true

In python script:

class SampleAction(Action):
    def run(self):
        osTestParam = None
        return {"osParam": osTestParam}

If this action ran from st2 web UI then it gives // Action produced no data output in action output box.

The patch here fixes the st2web UI to look for the error key as well. Modifying the backend to write the error to stderr seems inappropriate to avoid polluting the stderr field and since the validation can come from other runner types that doesn't have stderr.

@m4dcoder m4dcoder added this to the 3.6.0 milestone Aug 12, 2021
Copy link
Contributor

@m4dcoder m4dcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@m4dcoder m4dcoder merged commit 79c7eba into StackStorm:master Aug 13, 2021
@pradnya-orchestral pradnya-orchestral deleted the Enhancement_error_massage branch December 20, 2021 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants