Chef Selenium: rubyzip failure to allocate memory issue on Windows Server 2008

二次信任 提交于 2019-12-14 02:32:42

问题


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.


回答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}



回答2:


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



来源:https://stackoverflow.com/questions/29976315/chef-selenium-rubyzip-failure-to-allocate-memory-issue-on-windows-server-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!