REST API timeout with Powershell

Discussion created by MickSolliday604359 on Jul 31, 2018
Latest reply on Aug 3, 2018 by MickSolliday604359

I have some scripts that create CSVs and then powershell reads them, creates a JSON body with them, and passes them to the AE REST API. It works great except every two or three runs it gives me the following error after it waits for 60 seconds:


Invoke-RestMethod : {
"code" : 45110,
"error" : "An Automation Engine internal error occured.",
"details" : "Wait for response of request 30 timed out after 60 seconds."
At E:\TIMSdev\core\scripts\callapi.ps1:140 char:11
+ $APIRUN = Invoke-RestMethod -Uri $RUNURL -Method POST -Body $JSON -He ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

The full API call is:

Invoke-RestMethod -Uri http://servername:8088/ae/api/v1/200/executions -Method POST -Body $JSON -Headers System.Collections.Hashtable

Any help would be greatly appreciated.