Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout property not honored by msu_package #9245

Open
danielfloyd opened this issue Jan 21, 2020 · 4 comments
Open

timeout property not honored by msu_package #9245

danielfloyd opened this issue Jan 21, 2020 · 4 comments

Comments

@danielfloyd
Copy link

@danielfloyd danielfloyd commented Jan 21, 2020

Describe the problem

While provisioning a Windows 8.1 x64 vagrant box using packer and the chef-solo provisioner, I am attempting to install the Windows 8.1 Update 1 update using msu_package from a recipe. The update is large and times out after the default 600 seconds. When I add a timeout property to my msu_package definition, it still times out after 600 seconds.

Looking in the code, it appears the issue is because msu_package uses cab_package to actually do the work and it is not passing its timeout property down. See here:

declare_resource(:cab_package, new_resource.name) do

The expectation is that setting a timeout on msu_package would be honored.

Software Version

14.13.11

But the link I referenced above is on master so I'm assuming upgrading would not improve the situation.

Replication Case

Here is the code from the recipe I'm using to install the updates. KB2919442 installs fine and is a prereq for KB2919355, which is the one that times out. That said, the issue doesn't appear to be specific to KB2919355. Any update that takes longer than 600 seconds to install should trigger it. Note that the recipe checks for x86_64. KB2919355 on x86 installs within the 600 second timeout.

if node['platform_version'].to_f == 6.3 # 8.1 or 2012r2
  if node['kernel']['machine'] == 'x86_64'
    # KB2919442 is a prereq for KB2919355
    msu_package 'March 2014 servicing stack update for Windows 8.1 and Windows Server 2012 R2 x64' do
      source 'http://download.windowsupdate.com/c/msdownload/update/software/crup/2014/02/windows8.1-kb2919442-x64_f97d8290d9d75d96f163095c4cb05e1b9f6986e0.msu'
      action :install
    end
    # KB2919355 is a prereq for KB2999226 which is installed by VC++ 2015+ Redistributable on systems prior to Windows 10 which is a prereq by VMware guest tools
    msu_package 'Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64' do
      source 'http://download.windowsupdate.com/d/msdownload/update/software/crup/2014/02/windows8.1-kb2919355-x64_e6f4da4d33564419065a7370865faacf9b40ff72.msu'
      action :install
      timeout 1800
    end
end

Stacktrace

    vmware-iso:   * msu_package[Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64] action install
    vmware-iso:     * remote_file[Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64] action create
    vmware-iso:       - create new file c:\windows\temp\packer-chef-solo\local-mode-cache\cache\package\windows8.1-kb2919355-x64_e6f4da4d33564419065a7370865faacf9b40ff72.msu
    vmware-iso:       - update content in file c:\windows\temp\packer-chef-solo\local-mode-cache\cache\package\windows8.1-kb2919355-x64_e6f4da4d33564419065a7370865faacf9b40ff72.msu from none to b0c9ad
    vmware-iso:       (file sizes exceed 10000000 bytes, diff output suppressed)
    vmware-iso:     - install version 6.3.1.14 of package Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64
    vmware-iso:     * cab_package[Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64] action install
    vmware-iso:
    vmware-iso:       ================================================================================
    vmware-iso:       Error executing action `install` on resource 'cab_package[Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64]'
    vmware-iso:       ================================================================================
    vmware-iso:
    vmware-iso:       Mixlib::ShellOut::CommandTimeout
    vmware-iso:       --------------------------------
    vmware-iso:       command timed out:
    vmware-iso:       ---- Begin output of dism.exe /Online /English /Add-Package /PackagePath:"c:\users\vagrant\appdata\local\temp\chef20200117-2524-rw9ybp\windows8.1-kb2919355-x64.cab" /NoRestart ----
    vmware-iso:       STDOUT: Deployment Image Servicing and Management tool
    vmware-iso:       Version: 6.3.9600.16384
    vmware-iso:
    vmware-iso:       Image Version: 6.3.9600.16384
    vmware-iso:
    vmware-iso:       Processing 1 of 1 - Adding package Package_for_KB2919355~31bf3856ad364e35~amd64~~6.3.1.14
    vmware-iso:       STDERR:
    vmware-iso:       ---- End output of dism.exe /Online /English /Add-Package /PackagePath:"c:\users\vagrant\appdata\local\temp\chef20200117-2524-rw9ybp\windows8.1-kb2919355-x64.cab" /NoRestart ----
    vmware-iso:
    vmware-iso:       ProcessId: 3380
    vmware-iso:       app_name: C:\Windows\system32/dism.exe
    vmware-iso:       command_line: dism.exe /Online /English /Add-Package /PackagePath:"c:\users\vagrant\appdata\local\temp\chef20200117-2524-rw9ybp\windows8.1-kb2919355-x64.cab" /NoRestart
    vmware-iso:       timeout: 600
    vmware-iso:
    vmware-iso:       Resource Declaration:
    vmware-iso:       ---------------------
    vmware-iso:       # In c:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11-universal-mingw32/lib/chef/provider/package/msu.rb
    vmware-iso:
    vmware-iso:       109:             declare_resource(:cab_package, new_resource.name) do
    vmware-iso:       110:               source cab_file
    vmware-iso:       111:               action :install
    vmware-iso:       112:             end
    vmware-iso:       113:           end
    vmware-iso:
    vmware-iso:       Compiled Resource:
    vmware-iso:       ------------------
    vmware-iso:       # Declared in c:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11-universal-mingw32/lib/chef/provider/package/msu.rb:109:in `block in install_package'
    vmware-iso:
    vmware-iso:       cab_package("Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64") do
    vmware-iso:         package_name "Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64"
    vmware-iso:         action [:install]
    vmware-iso:         default_guard_interpreter :default
    vmware-iso:         declared_type :cab_package
    vmware-iso:         cookbook_name "packer"
    vmware-iso:         source "c:\\users\\vagrant\\appdata\\local\\temp\\chef20200117-2524-rw9ybp\\windows8.1-kb2919355-x64.cab"
    vmware-iso:         version "6.3.1.14"
    vmware-iso:       end
    vmware-iso:
    vmware-iso:       System Info:
    vmware-iso:       ------------
    vmware-iso:       chef_version=14.13.11
    vmware-iso:       platform=windows
    vmware-iso:       platform_version=6.3.9600
    vmware-iso:       ruby=ruby 2.5.5p157 (2019-03-15 revision 67260) [x64-mingw32]
    vmware-iso:       program_name=c:/opscode/chef/bin/chef-solo
    vmware-iso:       executable=c:/opscode/chef/bin/chef-solo
    vmware-iso:
    vmware-iso:
    vmware-iso:     ================================================================================
    vmware-iso:     Error executing action `install` on resource 'msu_package[Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64]'
    vmware-iso:     ================================================================================
    vmware-iso:
    vmware-iso:     Mixlib::ShellOut::CommandTimeout
    vmware-iso:     --------------------------------
    vmware-iso:     cab_package[Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64] (c:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11-universal-mingw32/lib/chef/provider/package/msu.rb line 109) had an error: Mixlib::ShellOut::CommandTimeout: command timed out:
    vmware-iso:     ---- Begin output of dism.exe /Online /English /Add-Package /PackagePath:"c:\users\vagrant\appdata\local\temp\chef20200117-2524-rw9ybp\windows8.1-kb2919355-x64.cab" /NoRestart ----
    vmware-iso:     STDOUT: Deployment Image Servicing and Management tool
    vmware-iso:     Version: 6.3.9600.16384
    vmware-iso:
    vmware-iso:     Image Version: 6.3.9600.16384
    vmware-iso:
    vmware-iso:     Processing 1 of 1 - Adding package Package_for_KB2919355~31bf3856ad364e35~amd64~~6.3.1.14
    vmware-iso:     STDERR:
    vmware-iso:     ---- End output of dism.exe /Online /English /Add-Package /PackagePath:"c:\users\vagrant\appdata\local\temp\chef20200117-2524-rw9ybp\windows8.1-kb2919355-x64.cab" /NoRestart ----
    vmware-iso:
    vmware-iso:     ProcessId: 3380
    vmware-iso:     app_name: C:\Windows\system32/dism.exe
    vmware-iso:     command_line: dism.exe /Online /English /Add-Package /PackagePath:"c:\users\vagrant\appdata\local\temp\chef20200117-2524-rw9ybp\windows8.1-kb2919355-x64.cab" /NoRestart
    vmware-iso:     timeout: 600
    vmware-iso:
    vmware-iso:     Resource Declaration:
    vmware-iso:     ---------------------
    vmware-iso:     # In c:/windows/temp/packer-chef-solo/local-mode-cache/cache/cookbooks/packer/recipes/updates.rb
    vmware-iso:
    vmware-iso:      27:     msu_package 'Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64' do
    vmware-iso:      28:       source 'http://download.windowsupdate.com/d/msdownload/update/software/crup/2014/02/windows8.1-kb2919355-x64_e6f4da4d33564419065a7370865faacf9b40ff72.msu'
    vmware-iso:      29:       action :install
    vmware-iso:      30:       timeout 1800
    vmware-iso:      31:     end
    vmware-iso:      32:   else
    vmware-iso:
    vmware-iso:     Compiled Resource:
    vmware-iso:     ------------------
    vmware-iso:     # Declared in c:/windows/temp/packer-chef-solo/local-mode-cache/cache/cookbooks/packer/recipes/updates.rb:27:in `from_file'
    vmware-iso:
    vmware-iso:     msu_package("Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64") do
    vmware-iso:       package_name "Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update: April 2014 x64"
    vmware-iso:       action [:install]
    vmware-iso:       default_guard_interpreter :default
    vmware-iso:       declared_type :msu_package
    vmware-iso:       cookbook_name "packer"
    vmware-iso:       recipe_name "updates"
    vmware-iso:       source "c:\\users\\vagrant\\appdata\\local\\temp\\chef20200117-2524-rw9ybp\\windows8.1-kb2919355-x64.cab"
    vmware-iso:       timeout 1800
    vmware-iso:     end
    vmware-iso:
    vmware-iso:     System Info:
    vmware-iso:     ------------
    vmware-iso:     chef_version=14.13.11
    vmware-iso:     platform=windows
    vmware-iso:     platform_version=6.3.9600
    vmware-iso:     ruby=ruby 2.5.5p157 (2019-03-15 revision 67260) [x64-mingw32]
    vmware-iso:     program_name=c:/opscode/chef/bin/chef-solo
    vmware-iso:     executable=c:/opscode/chef/bin/chef-solo

Possible Solution

Pass the timeout property from msu_package on to the child cab_package resources.

@KenzoB73

This comment has been minimized.

Copy link

@KenzoB73 KenzoB73 commented Feb 13, 2020

Seeing the same issue myself. I'm also using packer when seeing the issue.

Have you managed a workaround for the time being?

@danielfloyd

This comment has been minimized.

Copy link
Author

@danielfloyd danielfloyd commented Feb 13, 2020

Unfortunately, no. In my particular case, Windows 8.1 was a nice-to-have but not a requirement compared to other Windows versions, so we punted for the time being.

One workaround I thought about, but didn't explore, would be to basically recreate msu_package in a recipe so you have control over the timeout given to cab_package.

Another one might be forking Chef, making the change and somehow getting Packer to use the fork. I don't know if that is even possible. We ran into another issue where WinRM is super slow on Windows 10 with Packer and the transferring of Chef files to the VM was either timing out or taking forever (literally hours), and the possible solution we talked about was to use Packer's built in HTTP server to get the chef files into the VM rather than relying on the Packer Chef provisioner to do it. That might make using the forked Chef repo possible? Again, haven't explored it.

@KenzoB73

This comment has been minimized.

Copy link

@KenzoB73 KenzoB73 commented Feb 13, 2020

@danielfloyd

This comment has been minimized.

Copy link
Author

@danielfloyd danielfloyd commented Feb 14, 2020

Yes, it is. That's basically the same boat I was in. I was trying to get VMware guest tools to install under Windows 8.1, which requires four Windows updates, applied in order. Two of them are included in the guest tools installer. It took me a few days to track down the other two. One of them was Windows 8.1 Update 1, which is huge and takes longer than 600 seconds to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.