StackStorm / StackStorm/st2

User-friendly Error Reporting

Open
#2,320 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

complexity:hard enhancement
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

Problem

In the majority of cases when user get an error from StackStorm it's just unreadable raw Python traceback with very few useful information.

Good error messages should describe 2 things:

  • What wrong just happened (clearly)
  • How to fix it (best guess)
Example

Report from the #community

Single-line Jinja variables like {{ playbook }} should be enclosed with "{{ playbook }}" or they treated as dict.
Ex:

params:
    playbook: {{playbook}}

st2 shows this error:

st2 run st2-chatops-aliases.deploy_and_run_task playbook=test-slack.yml 
..
id: 56787954089f67469a3d7627
action.ref: st2-chatops-aliases.deploy_and_run_task
status: failed
error: Failed to run task "run_task". Parameter rendering failed: Failed rendering value for action parameter "playbook" in task "run_task" (template string={{[playbook}}): unexpected '}', expected ']'
traceback: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/st2actions/runners/actionchainrunner.py", line 307, in run
    action_params=action_parameters, context_result=context_result)
  File "/usr/lib/python2.7/dist-packages/st2actions/runners/actionchainrunner.py", line 504, in _get_next_action
    chain_context={'parent': parent_context})
  File "/usr/lib/python2.7/dist-packages/st2actions/runners/actionchainrunner.py", line 486, in _resolve_params
    raise ParameterRenderingFailedException(msg)
ParameterRenderingFailedException: Failed rendering value for action parameter "playbook" in task "run_task" (template string={{[playbook}}): unexpected '}', expected ']'

Here is how Ansible handles it:
stackstorm_ansible-st2_ 24_-circleci-_2015-12-22_04 07 23
It's a good example that shows where is the problem and how to fix it. They handle pretty a lot of possible corner cases, catching even upstream lib errors and overall have easy/useful error messages.


Just believe it's good example where to aim and what approach to follow someday if we want to make StackStorm more popular and repel less users:

  • user-readable errors
  • more validation
  • better overall error reporting (and less raw Python tracebacks)

Honestly, not too much cases when full Python traceback in st2 was useful for me personally (as a user).

Leaving it here as example and food for thinking.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the error flow shown in st2actions/runners/actionchainrunner.py, especially run, _get_next_action, and _resolve_params. Compare the current StackStorm output with the Ansible example in the issue. Done means defining and implementing a scoped approach to user-readable errors, validation, and reduced raw Python tracebacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.