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.
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.
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:
In python script:
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 tostderr
seems inappropriate to avoid polluting the stderr field and since the validation can come from other runner types that doesn't have stderr.