# Sql server installation failure

**URL:** <https://discourse.chef.io/t/sql-server-installation-failure/9912>\
**Category:** Chef Infra (archive)\
**Created:** [November 22, 2016, 4:43am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912 "2016-11-22T04:43:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudarshanaks](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sudarshanaks](https://discourse.chef.io/u/sudarshanaks)\
**Post date:** [November 22, 2016, 4:43am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/1 "2016-11-22T04:43:09Z")

</div>

Hi,  
I have written a cookbook for sqlserver installation (part of the code is given below). I’m facing such an issue where silent installation is happening (manually without using chef), But same installation through chef not happening.

puts "CD to #{node[:product][:location]}"  
execute “starting SQL Server #{node[:sql][:version]} installation on windows” do  
cwd node[:product][:location]  
command "#{setupfile}setup.exe /CONFIGURATIONFILE=#{responsefile} \> sqlserver.txt"  
guard\_interpreter :powershell\_script  
timeout 7200  
returns [0, 42, 127, 3010]  
ignore\_failure true  
end

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 1, 2016, 6:43am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/2 "2016-12-01T06:43:10Z")

</div>

Can you share more details about the failure? Perhaps a gist of the chef output or the `sqlserver.txt` file?

---

<div class="post-metadata">

**Author:** ![sudarshanaks](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sudarshanaks](https://discourse.chef.io/u/sudarshanaks)\
**Post date:** [December 1, 2016, 9:04am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/3 "2016-12-01T09:04:14Z")

</div>

Overall summary:  
Final result: Failed: see details below  
Exit code (Decimal): -2068774911  
Exit facility code: 1201  
Exit error code: 1  
Exit message: There was an error generating the XML document.  
Start time: 2016-12-01 13:59:32  
End time: 2016-12-01 13:59:55  
Requested action: Install  
Exception help link: [http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.2100.60&EvtType=0xE0C083E6%400xF80B8030&EvtType=0xE0C083E6%400xF80B8030](http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.2100.60&EvtType=0xE0C083E6%400xF80B8030&EvtType=0xE0C083E6%400xF80B8030)

Setup completed with required actions for features.  
Troubleshooting information for those features:  
Next step for SQLEngine: SQL Server Setup was canceled before completing the operation. Try the setup process again.  
Next step for Replication: SQL Server Setup was canceled before completing the operation. Try the setup process again.  
Next step for Adv\_SSMS: SQL Server Setup was canceled before completing the operation. Try the setup process again.  
Next step for SSMS: SQL Server Setup was canceled before completing the operation. Try the setup process again.  
Next step for SNAC: SQL Server Setup was canceled before completing the operation. Try the setup process again.  
Next step for SNAC\_SDK: SQL Server Setup was canceled before completing the operation. Try the setup process again.  
Next step for Writer: SQL Server Setup was canceled before completing the operation. Try the setup process again.  
Next step for Browser: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Machine Properties:  
Machine name: INMBZP5163  
Machine processor count: 4  
OS version: Future Windows Version  
OS service pack:  
OS region: United States  
OS language: English (United States)  
OS architecture: x64  
Process architecture: 64 Bit  
OS clustered: No

Product features discovered:  
Product Instance Instance ID Feature Language Edition Version Clustered

Package properties:  
Description: Microsoft SQL Server 2012  
ProductName: SQL Server 2012  
Type: RTM  
Version: 11  
SPLevel: 0  
Installation location: c:\chef\_download\x64\setup  
Installation edition: Evaluation

Product Update Status:  
User selected not to include product updates.

User Input Settings:  
ACTION: Install  
ADDCURRENTUSERASSQLADMIN: false  
AGTSVCACCOUNT: NT AUTHORITY\NETWORK SERVICE  
AGTSVCPASSWORD:   
AGTSVCSTARTUPTYPE: Disabled  
ASBACKUPDIR: Backup  
ASCOLLATION: Latin1\_General\_CI\_AS  
ASCONFIGDIR: Config  
ASDATADIR: Data  
ASLOGDIR: Log  
ASPROVIDERMSOLAP: 1  
ASSERVERMODE: MULTIDIMENSIONAL  
ASSVCACCOUNT:   
ASSVCPASSWORD:   
ASSVCSTARTUPTYPE: Automatic  
ASSYSADMINACCOUNTS:   
ASTEMPDIR: Temp  
BROWSERSVCSTARTUPTYPE: Disabled  
CLTCTLRNAME:   
CLTRESULTDIR:   
CLTSTARTUPTYPE: 0  
CLTSVCACCOUNT:   
CLTSVCPASSWORD:   
CLTWORKINGDIR:   
COMMFABRICENCRYPTION: 0  
COMMFABRICNETWORKLEVEL: 0  
COMMFABRICPORT: 0  
CONFIGURATIONFILE: c:\chef\_download\ConfigurationFile.ini  
CTLRSTARTUPTYPE: 0  
CTLRSVCACCOUNT:   
CTLRSVCPASSWORD:   
CTLRUSERS:   
ENABLERANU: false  
ENU: true  
ERRORREPORTING: false  
FEATURES: SQLENGINE, REPLICATION, SSMS, ADV\_SSMS, SNAC\_SDK  
FILESTREAMLEVEL: 0  
FILESTREAMSHARENAME:   
FTSVCACCOUNT:   
FTSVCPASSWORD:   
HELP: false  
INDICATEPROGRESS: true  
INSTALLSHAREDDIR: C:\Program Files\Microsoft SQL Server  
INSTALLSHAREDWOWDIR: C:\Program Files (x86)\Microsoft SQL Server  
INSTALLSQLDATADIR:   
INSTANCEDIR: C:\Program Files\Microsoft SQL Server  
INSTANCEID: MSSQLSERVER  
INSTANCENAME: MSSQLSERVER  
ISSVCACCOUNT: NT AUTHORITY\NetworkService  
ISSVCPASSWORD:   
ISSVCSTARTUPTYPE: Automatic  
MATRIXCMBRICKCOMMPORT: 0  
MATRIXCMSERVERNAME:   
MATRIXNAME:   
NPENABLED: 0  
PID: \*\*\*\*\*  
QUIET: true  
QUIETSIMPLE: false  
ROLE: AllFeatures\_WithDefaults  
RSINSTALLMODE: FilesOnlyMode  
RSSHPINSTALLMODE: DefaultSharePointMode  
RSSVCACCOUNT: NT AUTHORITY\NETWORK SERVICE  
RSSVCPASSWORD:   
RSSVCSTARTUPTYPE: Automatic  
SAPWD: \*\*\*\*\*  
SECURITYMODE: SQL  
SQLBACKUPDIR:   
SQLCOLLATION: SQL\_Latin1\_General\_CP1\_CI\_AS  
SQLSVCACCOUNT: NT AUTHORITY\NETWORK SERVICE  
SQLSVCPASSWORD:   
SQLSVCSTARTUPTYPE: Automatic  
SQLSYSADMINACCOUNTS: INMBZP5163\Administrator  
SQLTEMPDBDIR:   
SQLTEMPDBLOGDIR:   
SQLUSERDBDIR:   
SQLUSERDBLOGDIR:   
SQMREPORTING: false  
TCPENABLED: 1  
UIMODE: Normal  
UpdateEnabled: false  
UpdateSource: MU  
X86: false

Configuration file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20161201\_135859\ConfigurationFile.ini

Detailed results:  
Feature: Database Engine Services  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Feature: SQL Server Replication  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Feature: Management Tools - Complete  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Feature: Management Tools - Basic  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Feature: SQL Client Connectivity  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Feature: SQL Client Connectivity SDK  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Feature: SQL Writer  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Feature: SQL Browser  
Status: Failed: see logs for details  
Reason for failure: Setup was canceled for the feature.  
Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Rules with failures:

Global rules:

Scenario specific rules:

Rules report file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20161201\_135859\SystemConfigurationCheck\_Report.htm

Exception summary:  
The following is an exception stack listing the exceptions in outermost to innermost order  
Inner exceptions are being indented

Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException  
Message:  
There was an error generating the XML document.  
HResult : 0x84b10001  
FacilityCode : 1201 (4b1)  
ErrorCode : 1 (0001)  
Data:  
DisableWatson = true  
Stack:  
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)  
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.FlushCache(Boolean removeAllCachedObj)  
at Microsoft.SqlServer.Chainer.Infrastructure.NotificationHandler.Invoke(Object notification, Object[] objectArray)  
at Microsoft.SqlServer.Configuration.ConfigExtension.ConfigFeatureActionListener.InConfigurationActionExecutionEventHandler(ActionKey key, TextWriter loggingStream)  
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionMetadata.NotifyInExecution(ActionKey actionRunning, TextWriter loggingStream)  
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.InvokeAction(WorkflowObject metabase, TextWriter statusStream)  
at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions(WorkflowObject metaDb, TextWriter loggingStream)  
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionEngine.RunActionQueue()  
at Microsoft.SqlServer.Chainer.TimingConfigAction.Execute(String actionId, TextWriter errorStream)  
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun, ServiceContainer context)  
Inner exception type: System.InvalidOperationException  
Message:  
There was an error generating the XML document.  
Stack:  
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)  
at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)  
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)  
Inner exception type: System.Security.Cryptography.CryptographicException  
Message:  
Access is denied.

```
        Stack: 
                    at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
                    at Microsoft.SqlServer.Common.SqlSecureString.WriteXml(XmlWriter writer)
                    at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
                    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write7_SqlEngineSetupPublic(String n, String ns, SqlEngineSetupPublic o, Boolean isNullable, Boolean needType)
                    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write8_SqlEngineSetupPublic(Object o)

```

**strong text**

---

<div class="post-metadata">

**Author:** ![sudarshanaks](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sudarshanaks](https://discourse.chef.io/u/sudarshanaks)\
**Post date:** [December 1, 2016, 9:40am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/4 "2016-12-01T09:40:49Z")

</div>

recipe is given bellow

# 

# Cookbook Name:: sqlserverinstall

# Recipe:: default

# 

node.default[:product][:folder] = "sqlserver/"  
node.default[:product][:file] = "SQLFULL\_ENU.iso"  
node.default[:product][:extract] = '\SQLFULL\_ENU\'  
setupfile = node[:product][:location] + "\"  
tarfile = node[:product][:location] + “\” + node[:product][:file]  
responsefile = node[:product][:location] + “\ConfigurationFile.ini”

puts "#{node[‘machinename’]} ---- node[‘machinename’]"  
puts "#{node[‘domain’]} – node[‘domainname’]"  
puts “#{node[:sql][‘domain\_user’]} – domain\_user”

if (!(File.directory?(node[:sql][:installdir])))  
include\_recipe ‘downloader::default’  
template node[:product][:location] + “\ConfigurationFile.ini” do  
source "ConfigurationFile2012.ini.erb"  
end  
puts "Started Installing"  
if (!(File.directory?(node[:product][:location] + “\setup.exe”)))  
puts "unzipping #{tarfile} "  
execute “7zip to unzip all packages” do  
cwd node[:product][:location]  
command "#{node[:zip][:installdir]}\7z x #{tarfile}"  
not\_if { ::File.exists?(node[:product][:location] + “\setup.exe”) }  
end  
else  
puts "Already Unzipped files – skipping"  
end  
puts "#{setupfile}setup.exe /CONFIGURATIONFILE=’#{responsefile}’"  
puts "CD to #{node[:product][:location]}"  
execute “starting SQL Server #{node[:sql][:version]} installation on windows” do  
cwd node[:product][:location]  
command 'start /wait setup.exe /CONFIGURATIONFILE=“ConfigurationFile.ini” '  
guard\_interpreter :powershell\_script  
timeout 7200  
returns [0, 42, 127, 3010]  
sleep 7200  
ignore\_failure true  
end

else  
puts "Prodcut Installation found on server"  
end

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 1, 2016, 4:24pm UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/5 "2016-12-01T16:24:05Z")

</div>

What user is running the recipie and under what context is chef running (in a local console, via knife winrm, a service, etc)?

This issue is often the result of insufficient access rights of the account invoking the install,Make sure the account is a local administrator account. Try to avoid using a domain account since some have found this error to occur using a domain account.

---

<div class="post-metadata">

**Author:** ![sudarshanaks](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sudarshanaks](https://discourse.chef.io/u/sudarshanaks)\
**Post date:** [December 2, 2016, 4:48am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/6 "2016-12-02T04:48:56Z")

</div>

I’m using administrative account only . Please check following command  
knife bootstrap windows winrm FQDN --winrm-user Administrator --winrm-password password --node-name nodename --run-list ‘recipe[sqlserverinstall]’ --msi-url [http://local](http://local) repo/repo/chef-client-12.16.42-1-x86.msi

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 2, 2016, 5:28am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/7 "2016-12-02T05:28:47Z")

</div>

Ahh ok this makes sense now. Installing sqlserver is one of the few operations that will not run successfully over a normal winrm session. `knife winrm` provides an argument `--winrm-shell elevated` that creates a scheduled task to run the command in and makes it behave like a locally run command. Unfortunately `knife bootstrap` does not support this shell.

What you can do is bootstrap the node without a run list and then use `knife winrm` with `--winrm-shell elevated` to run `chef-client` and set the runlist to the sql installer.

---

<div class="post-metadata">

**Author:** ![sudarshanaks](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sudarshanaks](https://discourse.chef.io/u/sudarshanaks)\
**Post date:** [December 2, 2016, 6:03am UTC](https://discourse.chef.io/t/sql-server-installation-failure/9912/8 "2016-12-02T06:03:33Z")

</div>

Thanks a lot, Your suggestion really helped.
