cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

script timeout. Script is terminated

p_esposito
Guide

I have some alerts linked to a script recipient.

The script sends an http request to a remote incidents management system platform.

Everything works good, except some sporadic cases; in all this cases, reading the CAS\log\scriptexecution.log, I see a message flow like this:

1.

T SCRPT	17-10-27 07:44:15.903	Start: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "myscript.ps1"

2.

E SCRPT	17-10-27 07:44:25.904	C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "myscript.ps1" - script timeout. Script is terminated.

3.

T SCRPT	17-10-27 07:44:25.907	C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "myscript.ps1"  - terminate script.
T SCRPT 17-10-27 07:44:25.91 0 of 1 script item(s) have been successfully executed

4.

T SCRPT	17-10-27 07:44:25.915	End: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "myscript.ps1"

The script "myscript.ps1" logs every possible error, including http response timeouts from remote host, but when this error happens, only the information of "execution started" is logged and nothing else.

Is it possible to increment the timeout period of the script execution?

Thank you in advance

Pasquale

4 REPLIES 4

henk_stobbe
Mentor

Pasquale,

I have the same issue )-; I am only using powershell -c echo ... and still get the time-out,


KR Henk

You can achieve this by modifying general property SCRIPT_PROCESS_TIMEOUT. By default it is set to 10000 ms.

henk_stobbe
Mentor

Hi Robert,

Parameter did not exist, so I added it. Is this the correct procedure? Below did not work, time-out is still 10s

KR Henk

Some new found knowledge to add to this, so it may help someone in the future:

If using the powershell executable as script to execute, format the parameters section like this:

-command "& 'C:\Path_to\script.ps1'
-dcrum_message '{notificationMessage}' -param2 '<value>' ... "

Note:


  • The whole parameters section should be one line
    Parameters will not be passed to the script if they are separated by newlines (enters). Only anything up to the first <cr> will be used. So do not 'tidy up' that section 🙂

  • Call the powershell script, using the call operator (&).
    Required if there are special characters in the parameters, like &, or path contain spaces. So start with the &.
    Ref: https://ss64.com/ps/call.html

  • Use double quotes around the whole section. e.g.: