This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

Failed to execute action through API

I am running an action through API as below -

curl --insecure -X POST -H ‘Connection: keep-alive’ -H ‘Accept-Encoding: gzip, deflate’ -H ‘Accept: /’ -H ‘User-Agent: python-requests/2.14.2’ -H ‘content-type: application/json’ -H 'X-Auth-Token: ’ -H ‘Content-Length: 73’ --data-binary ‘{“action”: “core.local”, “user”: null, “parameters”: {“cmd”: “sudo systemctl stop ntpd”}}’ https:///api/v1/executions

Its failing with error

"faultstring": "Failed to parse request body: Unterminated string starting at: line 1 column 62 (char 61)"

If I run same API with commands like “ifconfig” it works, please let me know what wrong I am doing.

Please do needful.

Hard to say for certain, since you’ve masked out some details above. But most likely it’s just what the error is telling you - you have an unterminated string, usually due to misplaced or missing ' or ".

Try running your command from CLI with --debug, e.g. st2 --debug run core.local ...

That will display the equivalent curl calls. Compare those with what you’re using.