1

On Windows Server 2008 & 2008R2 the following exception occurs:

================================================================================
  Error executing action `install` on resource 'chef_gem[rubyzip]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
STDOUT:
  STDERR: [FATAL] failed to allocate memory
---- End output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
Ran C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" returned 1

This does NOT happen on Windows Server 2012 & 2012 R2.

Dennis Hoer
  • 3,039
  • 2
  • 23
  • 34

2 Answers2

1

From https://github.com/chef/knife-windows#nodes:

The Chef and Ohai gem installations (that occur during bootstrap) take more memory than the default 150MB WinRM allocates per shell on older versions of Windows (prior to Windows Server 2012) -- this can slow down bootstrap. Optionally increase the memory limit to 300MB with the following command:

winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}

Also note:

Windows 2008R2 and earlier versions require an extra configuration for MaxTimeoutms to avoid WinRM::WinRMHTTPTransportError: Bad HTTP response error while bootstrapping. It should be atleast 300000.

winrm set winrm/config @{MaxTimeoutms=300000}
Dennis Hoer
  • 3,039
  • 2
  • 23
  • 34
0

Adjusting the winrm settings did not fix the issue.

Rubyzip seems to be the issue with too many objects being allocated: http://blog.huangzhimin.com/2012/10/02/avoid-using-rubyzip/

Replacing the rubyzip implementation with powershell fixed the issue: https://stackoverflow.com/a/26843122/4548096

Community
  • 1
  • 1
Dennis Hoer
  • 3,039
  • 2
  • 23
  • 34