Powershell 'Run Script Block' action timing out

Document ID : KB000091765
Last Modified Date : 17/04/2018
Show Technical Document Details
Issue:
Powershell 'Run Script Block' action timing out while trying to retrieve a large artifact from jFrog Artifactory Server.

The script being used in the action is:
Invoke-WebRequest -Uri "https://artifactory.srv.com/artifactory/CRS_Install/rsitservwin-8.2.1.1100-wx64.exe" -OutFile "rsitservwin-8.2.1.1100-wx64.exe"

The nolio_action_exe log on the agent running the action shows the following:
2018-03-27 10:41:49,758 [job-754427-jobServer-888443-7:Powershell - Retrieve Reflections Application(P83680.F650555.E650556):PowerShell - Run Script Block] INFO (com.nolio.platform.shared.datamodel.Action:334) - ------------------------Finished action [Powershell - Retrieve Reflections Application(P83680.F650555.E650556):PowerShell - Run Script Block] result [false, Error: Exception occurred: ERROR: Execution timed out. Check output for details.]------------------------


The powershell command works outside Release Automation without issues. Total time for execution is around 2 minutes.
Even if we increase the 'Execution timeout' in the Inputs section of the action, it does not work.


 
Environment:
All versions of CA Release Automation
Resolution:
The Powershell action works with small artifacts but doesn't seem to work with large artifacts.
 The Powershell action was not designed to fetch large artifacts within in script block from Jfrog Artifactory. There are separate Jfrog Artifactory actions which can be used to fetch artifacts 'JFrog - Retrieve Artifacts'.

The workaround here is to using the command prompt using the -command switch in the script block as below:
powershell.exe -noprofile -command "Invoke-WebRequest -Uri https://artifactory.srv.com/artifactory/CRS_Install/rsitservwin-8.2.1.1100-wx64.exe -outfile rsitservwin-8.2.1.1100-wx64.exe"