Curl command execution returning false execution #5437
Unanswered
komalphadatare
asked this question in
Q&A
Replies: 1 comment
-
This is due to the behaviour of curl. If you perform a curl command on the same link manually and then check the return status code from the curl command, I believe that you will find that curl has returned a status code of 0, indicating success. There are flags with curl that you can use such as --fail that will cause curl to exit with non-zero, but it does then suppress failure output. Or you could use the core.http action. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After we execute "curl" command using remote.executor_sudo/local.executor_sudo and receive other than 200/202 response, it should set "error=true" and "succeeded=false" instead stackstom is setting as "error=false" and "succeeded=true".
E.g.
current output:
{
"succeeded": true,
"failed": false,
"return_code": 0,
"stderr": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 1076 0 0 100 1076 0 885 0:00:01 0:00:01 --:--:-- 885\r100 1076 0 0 100 1076 0 485 0:00:02 0:00:02 --:--:-- 485\r100 1076 0 0 100 1076 0 334 0:00:03 0:00:03 --:--:-- 334\r100 1172 100 96 100 1076 23 266 0:00:04 0:00:04 --:--:-- 266\r100 1172 100 96 100 1076 23 266 0:00:04 0:00:04 --:--:-- 266",
"stdout": {"error": {"message": "Error: Unable to find supported role version: 1.20.5-pmk.1912","code": 400}}
}
Expected output:
{
"succeeded": false,
"failed": true,
"return_code": 0,
"stderr": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 1076 0 0 100 1076 0 885 0:00:01 0:00:01 --:--:-- 885\r100 1076 0 0 100 1076 0 485 0:00:02 0:00:02 --:--:-- 485\r100 1076 0 0 100 1076 0 334 0:00:03 0:00:03 --:--:-- 334\r100 1172 100 96 100 1076 23 266 0:00:04 0:00:04 --:--:-- 266\r100 1172 100 96 100 1076 23 266 0:00:04 0:00:04 --:--:-- 266",
"stdout": {"error": {"message": "Error: Unable to find supported role version: 1.20.5-pmk.1912","code": 400}}
}
How can we handle such situation in stackstom?
Beta Was this translation helpful? Give feedback.
All reactions