sous-chefs / powershell

Development repository for the powershell cookbook
https://supermarket.chef.io/cookbooks/powershell
Apache License 2.0
110 stars 88 forks source link

powershell5 not installing... image file did not contain a resource section #80

Closed sarimali closed 8 years ago

sarimali commented 8 years ago
Recipe: powershell::powershell5
         * windows_package[Windows Management Framework Core 5.0] action install
         Recipe: <Dynamically Defined Resource>

             - create new file C:\Users\vagrant\AppData\Local\Temp\kitchen\cache\package\Win8.1AndW2K12R2-KB3066437-x64.msu
             - update content in file C:\Users\vagrant\AppData\Local\Temp\kitchen\cache\package\Win8.1AndW2K12R2-KB3066437-x64.msu from none to 9c5730
             (file sizes exceed 10000000 bytes, diff output suppressed)

           ================================================================================
           Error executing action `install` on resource 'windows_package[Windows Management Framework Core 5.0]'
           ================================================================================

           Chef::Exceptions::Win32APIError
           -------------------------------
           The specified image file did not contain a resource section.
           ---- Begin Win32 API output ----
           System Error Code: 1812
           System Error Message: The specified image file did not contain a resource section.
           ---- End Win32 API output ----

           Resource Declaration:
           ---------------------
           # In C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/powershell/recipes/powershell5.rb```
trevorghess commented 8 years ago

What version of chef-client are you using? I think you might be running into this issue on 12.6.0:

https://github.com/chef/chef/issues/4354

sarimali commented 8 years ago

yep... thanks! which version should i be using?

trevorghess commented 8 years ago

Until a new version is released with that fix, I'd recommend 12.5.1

sarimali commented 8 years ago

Still seeing that even after changing to omnibus 12.5.1. I then checked the .kitchen.yml in the repo and saw 11.18.6 and tried its the same error.

trevorghess commented 8 years ago

Did you destroy the box? Kitchen wasn't reverting for me when I was trying to roll back with this issue. I had to destroy and rebuild.

Other details about the setup? Windows version, current version of Powershell etc.?

sarimali commented 8 years ago

looks like i was forcing the latest regardless ... whoops

provisioner:
  name: chef_zero
  chef_metadata_url: 'https://www.chef.io/chef/metadata?p=windows&m=x86_64&pv=2012r2&v=latest'
trevorghess commented 8 years ago

:) We've all been there!

sarimali commented 8 years ago

im getting this now... Expected process to exit with [0, 42, 127, 3010], but received '5' ... i tried destroy first this time and i did this fix:

windows_service 'wuauserv' do
  startup_type :automatic
  action [ :enable, :start ]
end

no luck, any ideas?

Just a side point im experimenting the new dsc_resource in chef. Powershell 4 wouldn't work with dsc_script so i decided to give ps5 a shot. i can share my cookbook if you want to see what im doing.

trevorghess commented 8 years ago

Oh- it's an update. You're probably running into the winrm permissions issues using chef_zero... Try using chef-zero-scheduled-task: https://github.com/smurawski/chef-zero-scheduled-task