StackStorm / StackStorm/orquesta

Exception running workflow - 'ValueError: malformed node or string: <_ast.BinOp object at 0x7f80d29946d8>'

Open
#186 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
111
Forks
44
PR merge metrics
No merged PRs in 30d

Description

I haven't been able to find where this error is being generated from. As far as I can tell the action follows format and syntax correctly.

Action from workflow that is failing

  send_maintenance_start:
    action: email.send_email
    input:
      account: smarthost
      email_from: "no-reply@XXXXXX"
      email_to: "carlos@XXXXXX"
      subject: Incident detected on <% ctx("hostname") %>
      message: Automatic reboot of <% ctx("hostname") %> to recover from host down.
    next:
      - do: disable_users

Exception from workflowegine log.

2020-01-17 23:33:43,532 140191264317064 INFO (unknown file) [-] [5e22445438b7e59d28ade4fb] Mark task "send_maintenance_start", route "0", in conductor as running.
2020-01-17 23:33:43,580 140191264317064 INFO (unknown file) [-] [5e22445438b7e59d28ade4fb] Requesting execution for task "send_maintenance_start", route "0".
2020-01-17 23:33:43,580 140191264317064 INFO (unknown file) [-] [5e22445438b7e59d28ade4fb] Processing task execution request for task "send_maintenance_start", route "0".
2020-01-17 23:33:43,589 140191264317064 INFO (unknown file) [-] [5e22445438b7e59d28ade4fb] Task execution "5e22445738b7e59c9835e3ff" created for task "send_maintenance_start
", route "0".
2020-01-17 23:33:43,599 140191264317064 WARNING (unknown file) [-] Determining if exception <class 'ValueError'> should be retried.
2020-01-17 23:33:43,599 140191264317064 WARNING (unknown file) [-] Determining if exception <class 'ValueError'> should be retried.
2020-01-17 23:33:43,599 140191264317064 ERROR (unknown file) [-] [5e22445438b7e59d28ade4fb] Failed action execution(s) for task "send_maintenance_start", route "0". malforme
d node or string: <_ast.BinOp object at 0x7f80d29946d8>
Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/util/casts.py", line 36, in _cast_object
    return json.loads(x)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Contributor guide

No contributing guide indexed for this repository

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 with st2common/util/casts.py, especially _cast_object, and compare its JSON parsing path with the shown workflow action and execution log. Trace how the subject and message expressions are converted before email.send_email runs. Done means the source of the malformed AST value is identified and the failing workflow input is handled or clearly rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.