Esri / arcgis-cookbook

Chef cookbooks for ArcGIS
Apache License 2.0
297 stars 116 forks source link

Recipe Patch Mixlib::ShellOut::CommandTimeout #268

Closed thk70 closed 3 years ago

thk70 commented 3 years ago

Hi Some patches cannot be installed due to a timeout issue:

_Mixlib::ShellOut::CommandTimeout: arcgis_enterprise_patches[Install ArcGIS Enterprise Patches] (arcgis-enterprise::patches line 20) had an error: Mixlib::ShellOut::CommandTimeout: windows_package[Install E:/patches/ArcGIS-107-PFA-PSFD-Patch.msp] (E:/chef_cache/cookbooks/arcgis-enterprise/providers/patches.rb line 28) had an error: Mixlib::ShellOut::CommandTimeout: command timed out: ---- Begin output of start "" /wait "e:\patches\arcgis-107-pfa-psfd-patch.msp" /qn & exit %%%%ERRORLEVEL%%%% ---- STDOUT: STDERR: ---- End output of start "" /wait "e:\patches\arcgis-107-pfa-psfd-patch.msp" /qn & exit %%%%ERRORLEVEL%%%% ----

ProcessId: 8532 app_name: C:\Windows\system32\cmd.exe commandline: cmd /c "start "" /wait "e:\patches\arcgis-107-pfa-psfd-patch.msp" /qn & exit %%%%ERRORLEVEL%%%%" timeout: 600

Maybe 10 minutes is a bit short for some patches? Can I increase the timeout manually - like a parameter etc.?

cameronkroeker commented 3 years ago

Hi @thk70 ,

The default timeout for windows_package Resource is 600 seconds (10 minutes):

https://docs.chef.io/resources/windows_package/

Try adding 'timeout' to the below snippet:

https://github.com/Esri/arcgis-cookbook/blob/ae704a00cef52d34057569e36214f8669d539266/cookbooks/arcgis-enterprise/providers/patches.rb#L26-L34

For example:

# get all patches  within the specified folder and register them
    Dir.glob("#{patch_folder}/**/*").each do |patch|
      windows_package "Install #{patch}" do
        action :install
        source patch
        installer_type :custom
        options '/qn'
        timeout 600
      end
    end

Increase the 600 as needed.

Have you tried manually running the patch? Maybe its timing out due to an error that isn't being caught due to it silently being installed /qn. Can also check Windows Event Viewer Application logs to see if there are any messages that may provide a clue as to why its timing out.

thk70 commented 3 years ago

Hi, The packages are for portal 10.7 and named ArcGIS-107-PFA-PSFD-Patch.msp ArcGIS-107-PFA-SEC2020U1-Patch.msp

They install manually without issues. They take approx. 12 and 20 minutes to finish.

Increasing the time as you suggested was a success: Running handlers complete Chef Client finished, 3/3 resources updated in 33 minutes 36 seconds

Perhaps this timeout setting should be changed overall, or implemented as an option in the receipts/roles?

cameronkroeker commented 3 years ago

Thanks @thk70 glad to hear increasing the timeout worked. We will increase the timeout to 3600 (60 minutes) in the next release of the cookbook.

cameronkroeker commented 3 years ago

Hello @thk70 ,

We have addressed this issue in v370:

https://github.com/Esri/arcgis-cookbook/releases/tag/v3.7.0

https://github.com/Esri/arcgis-cookbook/blob/f973da68d5d092ebedc005bc9b79611e5aa5aaba/cookbooks/arcgis-enterprise/providers/patches.rb#L33

Thanks!