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

Issue with error 50 when installing mod_aspnet #285

Closed
wingZero21 opened this issue Jun 28, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@wingZero21
Copy link
Contributor

commented Jun 28, 2016

Cookbook version

[Version of the cookbook where you are encountering the issue]

Chef-client version

12.10.24

Platform Details

Windows Server 2012

Scenario:

Attempting to install .net 35 pre-requisites

Steps to Reproduce:

Running recipe iis::mod_aspnet

Expected Result:

When running I am getting the below errors.

==> default: [2016-06-28T01:06:44-07:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_feature[NetFx3] (iis::mod_aspnet line 31) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42, 127, 3010], but received '50'
==> default: ---- Begin output of C:\Windows\system32\dism.exe /online /enable-feature /featurename:NetFx3 /norestart   ----
==> default: STDOUT: Deployment Image Servicing and Management tool
==> default:
==> default: Version: 6.3.9600.17031
==> default:
==> default:
==> default:
==> default: Image Version: 6.3.9600.17031
==> default:
==> default:
==> default:
==> default: Enabling feature(s)
==> default:
==> default:
==> default:
==> default: Error: 50
==> default:
==> default:
==> default:
==> default: The operation is complete but NetFx3 feature was not enabled.
==> default:
==> default: A required parent feature may not be enabled. You can use the /enable-feature /all option to automatically enable each parent feature from the following list. If the parent feature(s) are already enabled, refer to the log file for further diagnostics.
==> default:
==> default: NetFx3ServerFeatures
==> default:
==> default: The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
==> default: STDERR:
==> default: ---- End output of C:\Windows\system32\dism.exe /online /enable-feature /featurename:NetFx3 /norestart   ----
==> default: Ran C:\Windows\system32\dism.exe /online /enable-feature /featurename:NetFx3 /norestart   returned 50

Potential Fix

Amended the mod_aspnet recipe detailed below.

Details:
Original

include_recipe 'iis'
include_recipe 'iis::mod_isapi'

features = if Opscode::IIS::Helper.older_than_windows2008r2?
             %w(NET-Framework)
           else
             %w(IIS-NetFxExtensibility IIS-ASPNET)
           end

features.each do |feature|
  windows_feature feature do
    action :install
  end
end

Amendment

include_recipe 'iis'
include_recipe 'iis::mod_isapi'

features = if Opscode::IIS::Helper.older_than_windows2008r2?
             %w(NET-Framework)
           else
             %w(NetFx3 IIS-NetFxExtensibility IIS-ASPNET)
           end

features.each do |feature|
  windows_feature feature do
    action :install
    all true
  end
end
@wingZero21

This comment has been minimized.

Copy link
Contributor Author

commented Jun 28, 2016

Added pull request to fix this - #286

@EasyAsABC123

This comment has been minimized.

Copy link
Collaborator

commented Jun 29, 2016

Resolved in #286

@joshoohaah

This comment has been minimized.

Copy link

commented Aug 23, 2017

FYI. this will still happen on 2012 and 2016 if the image has some Windows updates (2966827 or
2966828) installed on it. This hotfix (https://support.microsoft.com/en-us/help/3005628/update-for-the--net-framework-3-5-on-windows-8--windows-8-1--windows-s ) solves that problem and allows Netfx3 to install so these other components can install. I wonder if there is value in adding this check to the cookbook?

@EasyAsABC123

This comment has been minimized.

Copy link
Collaborator

commented Aug 23, 2017

We can definitely look into that

@spuder

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2017

My workaround for this issue
Download hotfix and install it before installing .net 3.5

Note microsoft offers .exe and .msu hotfixes. The msu hotfix is best for machines that have had windows updates cleaned up with DISM "/StartComponentCleanup" and "/ResetBase" . This url is for the msu hotfix

remote_file 'hotfix KB2966828' do
  path "#{Chef::Config[:file_cache_path]}/Windows8.1-KB2966828-x64.msu"
  source 'http://go.microsoft.com/fwlink/?linkid=517245&clcid=0x409' # Best to cache this on artifact repository incase microsoft ever changes url
  action :nothing
end

# Requires chef >=12.17
msu_package 'KB2966828' do
  source "#{Chef::Config[:file_cache_path]}/Windows8.1-KB2966828-x64.msu"
  checksum 'f8928bd61d6026343b03774427d3e945e51806576eb23c97a98d68434515c60d'
  action :nothing
  notifies :create, 'remote_file[hotfix KB2966828]', :before
end

windows_feature 'NetFx3' do
  action :install
  all true
  notifies :install, 'msu_package[KB2966828]', :before
end

windows_feature 'NetFx3ServerFeatures' do
  action :install
  all true
  notifies :install, 'msu_package[KB2966828]', :before
end

Update

The October 2017 Security roll up (KB4040981) replaces the need for hotfix KB2966828. .NET 3.5 won't install if hotfix KB2966828 and security roll up KB4040981 are both installed.

The following wont install KB2966828 if KB4040981 is present

msu_package 'KB2966828' do
  source "#{Chef::Config[:file_cache_path]}/Windows8.1-KB2966828-x64.msu"
  checksum 'f8928bd61d6026343b03774427d3e945e51806576eb23c97a98d68434515c60d'
  action :nothing
  notifies :create, 'remote_file[hotfix KB2966828]', :before
  guard_interpreter :powershell_script
  not_if { [bool]$(Get-Hotfix -id 'KB4040981' -ErrorAction SilentlyContinue) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.