mwrock / packer-templates

Templates for creating vagrant boxes
Other
535 stars 250 forks source link

Failure in creation of Windows 2016 images #111

Open trixomixolydian opened 6 years ago

trixomixolydian commented 6 years ago

100% consistent failure in creation of Windows 2016 image. Creation of Windows 2012r2 is fine so I do not believe it is locally related to the Chef DK PC that is performing the operation. executed:

packer build -force -only virtualbox-iso .\vbox-2016.json

(removed lines that seemed normal but can post them if needed. Only snipped around where is seemed to start to go haywire)

virtualbox-iso: Creating configuration file 'solo.rb'
virtualbox-iso: Creating JSON attribute file
virtualbox-iso: Executing Chef: c:/opscode/chef/bin/chef-solo.bat --no-color -c C:/Windows/Temp/packer-chef-solo/solo.rb -j C:/Windows/Temp/packer-chef-solo/node.json
virtualbox-iso: Starting Chef Client, version 14.0.202
virtualbox-iso: resolving cookbooks for run list: ["wsus-client::configure", "packer-templates::install_ps_modules", "packer-templates::vbox_guest_additions", "packer-templates::uninstall_powershell_ise", "packer-templates::delete_pagefile"]
virtualbox-iso: [2018-05-07T14:28:09+00:00] WARN: Child with name 'packer-templates' found in multiple directories: C:/Windows/Temp/packer-chef-solo/cookbooks-0/packer-templates and C:/Windows/Temp/packer-chef-solo/cookbooks-1/packer-templates

(the last line of the block above above duplicates dozens of times before moving to the following)

virtualbox-iso: Synchronizing Cookbooks:
virtualbox-iso:   - wsus-client (2.0.0)
virtualbox-iso:   - packer-templates (0.1.0)
virtualbox-iso:   - windows (4.2.2)
virtualbox-iso: Installing Cookbook Gems:
virtualbox-iso: Compiling Cookbooks...
virtualbox-iso:
virtualbox-iso: ================================================================================
virtualbox-iso: Recipe Compile Error in c:/windows/temp/packer-chef-solo/local-mode-cache/cache/cookbooks/windows/libraries/windows_package.rb
virtualbox-iso: ================================================================================

virtualbox-iso: LoadError
virtualbox-iso: ---------
virtualbox-iso: cannot load such file -- chef/mixin/language
virtualbox-iso:
virtualbox-iso: System Info:
virtualbox-iso: ------------
virtualbox-iso: chef_version=14.0.202
virtualbox-iso: platform=windows
virtualbox-iso: platform_version=10.0.14393
virtualbox-iso: ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
virtualbox-iso: program_name=c:/opscode/chef/bin/chef-solo
virtualbox-iso: executable=c:/opscode/chef/bin/chef-solo
virtualbox-iso:
virtualbox-iso:
virtualbox-iso: Running handlers:
virtualbox-iso: [2018-05-07T14:28:12+00:00] ERROR: Running exception handlers
virtualbox-iso: [2018-05-07T14:28:12+00:00] ERROR: Running exception handlers
virtualbox-iso: Running handlers complete
virtualbox-iso: [2018-05-07T14:28:12+00:00] ERROR: Exception handlers complete
virtualbox-iso: [2018-05-07T14:28:12+00:00] ERROR: Exception handlers complete
virtualbox-iso: Chef Client failed. 0 resources updated in 09 seconds
virtualbox-iso: [2018-05-07T14:28:12+00:00] FATAL: Stacktrace dumped to c:/windows/temp/packer-chef-solo/local-mode-cache/cache/chef-stacktrace.out
virtualbox-iso: [2018-05-07T14:28:12+00:00] FATAL: Stacktrace dumped to c:/windows/temp/packer-chef-solo/local-mode-cache/cache/chef-stacktrace.out
virtualbox-iso: [2018-05-07T14:28:12+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
virtualbox-iso: [2018-05-07T14:28:12+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
virtualbox-iso: [2018-05-07T14:28:12+00:00] FATAL: LoadError: cannot load such file -- chef/mixin/language
virtualbox-iso: [2018-05-07T14:28:12+00:00] FATAL: LoadError: cannot load such file -- chef/mixin/language

==> virtualbox-iso: Deregistering and deleting VM... ==> virtualbox-iso: Deleting output directory... Build 'virtualbox-iso' errored: Error executing Chef: Non-zero exit status: 1

==> Some builds didn't complete successfully and had errors: --> virtualbox-iso: Error executing Chef: Non-zero exit status: 1

==> Builds finished but no artifacts were created.

trixomixolydian commented 6 years ago

Changing provisioner settings as suggested in the following posts:

https://github.com/mwrock/packer-templates/issues/90 https://github.com/mwrock/packer-templates/issues/99

Since the failures seem to surface due to some cookbook coding that has been deprecated in 14.0.202, I decided to go back to the newest 13.x client by setting the chef client version. Haven't tried to incrementally do anything in the 14.x versions to narrow it down.

"provisioners": [ { "type": "chef-solo", "version": "13.9.1", "cookbook_paths": ["cookbooks", "vendor/cookbooks"], "guest_os_type": "windows", "run_list": [ "wsus-client::configure", "packer-templates::install_ps_modules", "packer-templates::vbox_guest_additions", "packer-templates::uninstall_powershell_ise", "packer-templates::delete_pagefile" ] },

Now on to other configuration management challenges with templates and source files for windows 2016 and adding roles and features through chef cookbook development.......

ilovemysillybanana commented 6 years ago

had this issue as well, it doesn't happen if you delete the Berks.lock file he provided. You have to delete it so that berks will pull the latest changes.

darkn3rd commented 6 years ago

@trixomixolydian Win2012 json doesn't use Chef Solo as the provisioner, it uses scripts/provision.ps1. Win2016 does unfortunately.

ilovemysillybanana commented 6 years ago

@darkn3rd Do you know why that changed? I'm new still new to Windows in a professional setting and I haven't had to touch anything older than 2k16.

darkn3rd commented 6 years ago

Win2012 uses shell provisioner, and I am guessing @mwrock chose chef-solo w/ windows cookbook to make managing win updates easier. But then as time passed, windows cookbook is no longer compatible with Chef. Fortunately the necessary resources have been absorbed by Chef 14, and windows cookbook was never updated to remove those pieces (and not use deprecated libraries in chef). It's safe to remove it from dependencies.