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

Orquesta publish error message could be more friendly #4429

Closed
nmaludy opened this issue Nov 7, 2018 · 3 comments
Closed

Orquesta publish error message could be more friendly #4429

nmaludy opened this issue Nov 7, 2018 · 3 comments

Comments

@nmaludy
Copy link
Member

nmaludy commented Nov 7, 2018

SUMMARY

When trying to publish a variable and i accidentally put in a dict instead of an array, the error message was confusing and not obvious what i needed to change the data type to.

ISSUE TYPE
  • Bug Report
STACKSTORM VERSION
$ st2 --version
st2 3.0dev (3ac37d0), on Python 2.7.5
OS / ENVIRONMENT / INSTALL METHOD
$ cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 

# Install method = puppet-st2
STEPS TO REPRODUCE

Action

---
name: basic_workflow
description: A basic sequential workflow.
runner_type: orquesta
entry_point: workflows/basic_workflow.yaml
enabled: true
parameters:
  key:
    required: true
    type: string
    default: test.datastore.key

Workflow

version: 1.0
  
description: A basic sequential workflow.

input:
  - key

vars:
  - read: null

output:
  - read: "{{ ctx().read }}"

tasks:
  get:
    action: st2.kv.get
    input:
      key: "{{ ctx().key }}"
    next:
      - when: "{{ succeeded() }}"
        publish:
          read: "{{ result() }}"
EXPECTED RESULTS

I was able to quickly determine where in the workflow the error was (the publish statement). However, the error message '{''read'': ''{{ result() }}''} is not valid under any of the given schemas' did not provide what the valid schemas were. It would be nice if it told you what the expected schema was and what data type you provided. In this case i provided a dict instead of an array of one-key dicts.

ACTUAL RESULTS
$ st2 run default.basic_workflow
.
id: 5be2ea719387ef099b022feb
action.ref: default.basic_workflow
parameters: None
status: failed
start_timestamp: Wed, 07 Nov 2018 13:36:49 UTC
end_timestamp: Wed, 07 Nov 2018 13:36:49 UTC
result: 
  errors:
  - message: '{''read'': ''{{ result() }}''} is not valid under any of the given schemas'
    schema_path: properties.tasks.patternProperties.^\w+$.properties.next.items.properties.publish.oneOf
    spec_path: tasks.get.next[0].publish
    type: syntax
  output: null
@cognifloyd
Copy link
Member

StackStorm/orquesta#97 publish and anything else that uses multiple schemas (anyOf, allOf, oneOf) could use more verbose messages.

@m4dcoder
Copy link
Contributor

m4dcoder commented Nov 7, 2018

This is related to what @cognifloyd already reported. We will revisit this post v3.0.

@m4dcoder
Copy link
Contributor

m4dcoder commented Nov 7, 2018

Closing issue since this is a duplicate of StackStorm/orquesta#97.

@m4dcoder m4dcoder closed this as completed Nov 7, 2018
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

No branches or pull requests

3 participants