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

Silently fails installing IIS-ASPNET45 on Win2012 due to 64-bit DISM issues #9

Open
jkoberg opened this issue Oct 17, 2013 · 3 comments

Comments

@jkoberg
Copy link

jkoberg commented Oct 17, 2013

Attempting to install IIS-ASPNET45 via Chef recipe on a freshly-bootstrapped stock Windows 2012 AMI.

I get the following text in the log:

Error: 11

You cannot service a running 64-bit operating system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to your computer's architecture.

The entire run is at http://pastebin.com/hXn14VPg and shows the command leading to that error at line 43.

@jkoberg
Copy link
Author

jkoberg commented Oct 17, 2013

The full text for reference:

Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> chef-client
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:4: Use RbConfig instead of obsolete and deprecated Config.
Starting Chef Client, version 11.6.2
[2013-10-17T14:38:59+00:00] INFO: *** Chef 11.6.2 ***
[2013-10-17T14:39:04+00:00] WARN: unable to detect ip6address
[2013-10-17T14:39:12+00:00] INFO: Run List is [recipe[versionone]]
[2013-10-17T14:39:12+00:00] INFO: Run List expands to [versionone]
[2013-10-17T14:39:12+00:00] INFO: Starting Chef Run for i-7d4fa407
[2013-10-17T14:39:12+00:00] INFO: Running start handlers
[2013-10-17T14:39:12+00:00] INFO: Start handlers complete.
resolving cookbooks for run list: ["versionone"]
[2013-10-17T14:39:13+00:00] INFO: Loading cookbooks [chef_handler, chocolatey, iis, powershell, versionone, webpi, windows]
Synchronizing Cookbooks:
  - versionone
  - iis
  - windows
  - chef_handler
  - webpi
  - chocolatey
  - powershell
Compiling Cookbooks...
[2013-10-17T14:39:13+00:00] INFO: Powershell light-weight provider already initialized -- overriding!
[2013-10-17T14:39:14+00:00] WARN: PowerShell 2.0 is not supported on this version of Windows: 6.2.9200
Converging 3 resources
Recipe: chocolatey::default
  * powershell[install chocolatey] action run[2013-10-17T14:39:14+00:00] INFO: Processing powershell[install chocolatey]
 action run (chocolatey::default line 23)
 (skipped due to not_if)
  * file[cygwin log] action delete[2013-10-17T14:39:14+00:00] INFO: Processing file[cygwin log] action delete (chocolatey::default line 28)
 (up to date)
Recipe: versionone::default
  * chocolatey[IIS-ASPNET45] action install[2013-10-17T14:39:14+00:00] INFO: Processing chocolatey[IIS-ASPNET45] action
install (versionone::default line 12)
 (up to date)
Recipe: <Dynamically Defined Resource>
  * execute[install package] action run[2013-10-17T14:39:14+00:00] INFO: Processing execute[install package] action run
(c:/chef/cache/cookbooks/chocolatey/providers/default.rb line 41)
Chocolatey (v0.9.8.20) is installing IIS-ASPNET45 and dependencies (from Windows Features). By installing you accept the license for IIS-ASPNET45 and each dependency you are installing.
Opening minimized PowerShell window and calling 'cmd.exe /c DISM /Online /NoRestart /Enable-Feature /all /FeatureName:IIS-ASPNET45'. If progress is taking a long time, please check that window. It also may not be 100% silent...
Elevating Permissions and running C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "& import-module -name  'C:\Chocolatey\chocolateyinstall\helpers\chocolateyInstaller.psm1'; try{cmd.exe /c DISM /Online /NoRestart /Enable-Feature /all /FeatureName:IIS-ASPNET45 | Tee-Object -FilePath 'C:\Chocolatey\chocolateyinstall\chocolateyWindowsFeaturesInstall.log';}catch{write-error 'That was not sucessful';throw;}". This may take awhile, depending on the statements.

Deployment Image Servicing and Management tool
Version: 6.2.9200.16384


Error: 11

You cannot service a running 64-bit operating system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to your computer's architecture.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
Finished installing 'IIS-ASPNET45' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure.
[2013-10-17T14:39:17+00:00] INFO: execute[install package] ran successfully

    - execute C:/Chocolatey/bin/cinst.bat IIS-ASPNET45 -source windowsfeatures
[2013-10-17T14:39:18+00:00] INFO: Chef Run complete in 5.304038 seconds
[2013-10-17T14:39:18+00:00] INFO: Running report handlers
[2013-10-17T14:39:18+00:00] INFO: Report handlers complete
Chef Client finished, 1 resources updated
PS C:\Windows\system32>

@juliandunn
Copy link

The provider just needs to use the sysnative dism command to fix this, because Chef is running under a 32-bit Ruby on Windows. Here's how we do it:

https://github.com/opscode-cookbooks/windows/blob/master/libraries/windows_helper.rb#L34

And then we use locate_sysnative_cmd("dism.exe") to get the right dism.exe.

@tyrken
Copy link

tyrken commented Apr 2, 2014

Alternatively, we can switch to using the "batch" resource rather than "execute" inside the actions - doing this on a fork at the moment & seems to work (no PR yet as incomplete). Unfortunately Mixlib::Shellout doesn't seem to have a similar ability, but isn't so crucial.

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

No branches or pull requests

3 participants