StackStorm action times out at 180 seconds


(Deepchandna) #1

Hi,

I am calling a rest API from StackStorm and gave timeout as 600 but it stops at 180 seconds everytime and starts new process

 
  st2 run core.local cmd='curl --globoff "http://deep.it.com/rest/deep_API.pl?val1=hello"' timeout=600
  
status: succeeded
parameters:
  cmd: curl --globoff "http://deep.it.com/rest/deep_API.pl?val1=hello"
  timeout: 600
result:
  failed: false
  return_code: 0
  stderr: "  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    33    0    33    0     0      0      0 --:--:--  0:03:00 --:--:--    10"
  stdout: 'Error: Process is already running'
  succeeded: true

Is there any other way to call API or HTTP urls ?


(Lindsay Hill) #2

Have you done any minimal testing like seeing what happens when you run that command manually?

Yes, there are many different ways of doing it.


(Deepchandna) #3

When i am doing curl to api , It timeout in 180 seconds. Is there configuration in stackstorm i need to change?

Can you also share me the link to to fix it?, pls


(Deepchandna) #4

Yes, I tested it completely. Manual run is good on server but via st2’ it is always tiMing out in 180 seconds. Also tried core.http and curl maxtime’; connection time out and other options but still same .


(Deepchandna) #5

Here is the minimal testing -

$ st2 run core.local cmd="/stackstorm/test_api1.sh" timeout=600
.........................................................................................
id: 5c8809b0364egtr4556
status: succeeded
parameters:
  cmd: /stackstorm/test_api1.sh
  timeout: 600
result:
  failed: false
  return_code: 0
  stderr: "  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    33    0    33    0     0      0      0 --:--:--  0:03:00 --:--:--     8"
  stdout: 'Error: Process is already running'
  succeeded: true
$


cat /stackstorm/test_api1.sh
curl http://dev.itt.com/rest/TEST_API.pl?trans=hello

In the example above , curl command ends at 180 (03:00 minutes) always. I put timeout more then 180 but that does matter.

In StackStorm, Is it configured anywhere that curl command can only run for 180 seconds ? because i am able to successfully run it manually ,

Please suggest the solution.