User-friendly Error Reporting
Nobody has claimed this yet.
- 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:

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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