Code Monkey home page Code Monkey logo

sql_server's Introduction

sql_server Cookbook

Cookbook Version CI State OpenCollective OpenCollective License

Provides resources for the installation and configuration of Microsoft SQL Server server and client. Includes several basic recipes that utilize install and configure resources. See the usage section below for more information.

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Platforms

  • Windows Server 2012 (R1, R2)
  • Windows Server 2016
  • Windows Server 2019

Supported Server Verions

  • Microsoft SQL Server 2012
  • Microsoft SQL Server 2016
  • Microsoft SQL Server 2017
  • Microsoft SQL Server 2019
  • Microsoft SQL Server 2022

Supported Client Versions

  • Microsoft SQL Server 2012

Chef

  • Chef 15.3+

Resources

Installing SQL Server remotely

SQL Server does not support remote installation over WinRM. For example, the installation fails when you run knife bootstrap windows winrm or knife winrm 'chef-client' with a run-list that includes server.rb. However, you can use a scheduled task or run chef-client as a service.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

sql_server's People

Contributors

annih avatar bhavya5491 avatar damacus avatar e100 avatar iennae avatar jblanksoftware avatar jhboricua avatar jugatsu avatar kitchen-porter avatar lbn-chef-team avatar miguelaferreira avatar mreynoldselevate avatar mrgiga avatar nathenharvey avatar ramereth avatar renovate[bot] avatar rhealitycheck avatar robert-rehberg avatar robertrehberg avatar scarolan avatar schisamo avatar sethvargo avatar smurawski avatar sneal avatar spuder avatar tas50 avatar thelunaticscripter avatar tpetchel avatar webframp avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sql_server's Issues

Unable to install more than one instance with same package version

Cookbook version

5.4.0 (with the fix #114)

Chef-client version

13.0.118

Platform Details

Windows Server 2012 R2

Scenario:

I'm trying to use custom ressource to install two or more instance on the same server.

Steps to Reproduce:

Create a wrapper cookbook with the following content in the recipe:

sql_server_install `Install SQL Server 2016 =>  instance1` do
  source_url 'c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe'
  version '2016'
  package_checksum '0a9a202671068ddd160f9d535f0ab8523048805dba852c4b9f79193227a6cc64'
  accept_eula true
  instance_name 'INSTANCE1'
  feature %w(SQLENGINE, CONN)
end

sql_server_install `Install SQL Server 2016 =>  instance2` do
  source_url 'c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe'
  version '2016'
  package_checksum '0a9a202671068ddd160f9d535f0ab8523048805dba852c4b9f79193227a6cc64'
  accept_eula true
  instance_name 'INSTANCE2'
  feature %w(SQLENGINE, CONN)
end

Expected Result:

I expect that the two instances are installed at the end of the chef-client

Actual Result:

Only the first instance is installed. The second instance show this message:

[2018-01-10T14:28:10+01:00] DEBUG: windows_package[Microsoft SQL Server 2016 (64-bit)] checking package version
[2018-01-10T14:28:10+01:00] INFO: Processing remote_file[c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe] action create (dynamically defined)
[2018-01-10T14:28:10+01:00] DEBUG: remote_file[c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe] checksumming file at c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe.
[2018-01-10T14:28:10+01:00] DEBUG: remote_file[c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe] checking for changes
[2018-01-10T14:28:10+01:00] DEBUG: remote_file[c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe] checksum matches target checksum (0a9a202671068ddd160f9d535f0ab8523048805dba852c4b9f79193227a6cc64) - not updating
[2018-01-10T14:28:10+01:00] DEBUG: windows_package[Microsoft SQL Server 2016 (64-bit)] fetched source file to c:\chef\cache\package\SQLServer2016SP1-FullSlipstream-x64-ENU.exe
[2018-01-10T14:28:10+01:00] DEBUG: windows_package[Microsoft SQL Server 2016 (64-bit)] checking package version
[2018-01-10T14:28:10+01:00] DEBUG: windows_package[Microsoft SQL Server 2016 (64-bit)] Microsoft SQL Server 2016 (64-bit) [nil] already installed
[2018-01-10T14:28:10+01:00] DEBUG: windows_package[Microsoft SQL Server 2016 (64-bit)] is already installed - nothing to do

This problem seems to be due to package ressource that is idempotent with the package name /display name from Windows Registry. I have no idea to bypass this :(

Best Regards,

generate ConfigurationFile.ini dynamically from attributes

Handle configuration file creation dynamically from attributes:

./templates/default/ConfigurationFile.ini:

<% @properties.each_pair do |key, value| -%>
  <% if value.is_a? Array -%>
<%= key %>=<%= value.map { |item| %("#{item}") }.join(' ') %>
  <% else -%>
<%= key %>="<%= value %>"
  <% end -%>
<% end -%>

example environment json:

{
  "sql_server": {
    "install": {
      "properties": {
        "key1": "value1",
        "key2": "value2",
        "array": ["item1", "item2", "item3"]
      }
    }
  }
}

end result:

key1="value1"
key2="value2"
array="item1" "item2" "item3"

This way the comments are lost, but also that can be attached if really necessary

Error when installing client on a machine already running SQL server 2012

When running on a machine with a preexisting SQL Server 2012 installed, I am getting the error below:

# Declared in c:/chef/cache/cookbooks/sql_server/recipes/client.rb:26:inblock in from_file'

windows_cookbook_package("Microsoft SQL Server 2008 R2 Management Objects (x64)") do
provider Chef::Provider::WindowsCookbookPackage
action [:install]
retries 0
retry_delay 2
guard_interpreter :default
cookbook_name "sql_server"
recipe_name "client"
source "http://download.microsoft.com/download/F/E/D/FEDB200F-DE2A-46D8-B661-D019DFE9D470/ENU/x64/SharedManagementObjects.msi"
checksum "ed753d85b51e7eae381085cad3dcc0f29c0b72f014f8f8fba1ad4e0fe387ce0a"
installer_type :msi
options "IACCEPTSQLNCLILICENSETERMS=YES"
success_codes [0, 42, 127]
package_name "Microsoft SQL Server 2008 R2 Management Objects (x64)"
timeout 600
end`

Error

'#<Mixlib::ShellOut::ShellCommandFailed: windows_package[Microsoft SQL Server 2008 R2 Management Objects (x64)] (sql_server::client line 26) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42, 127], but received '1641' ---- Begin output of msiexec /qn /i "c:\chef\cache\SharedManagementObjects.msi" IACCEPTSQLNCLILICENSETERMS=YES ---- STDOUT: STDERR: ---- End output of msiexec /qn /i "c:\chef\cache\SharedManagementObjects.msi" IACCEPTSQLNCLILICENSETERMS=YES ---- Ran msiexec /qn /i "c:\chef\cache\SharedManagementObjects.msi" IACCEPTSQLNCLILICENSETERMS=YES returned 1641> had an error:
windows_package[Microsoft SQL Server 2008 R2 Management Objects (x64)](sql_server::client line 26) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42, 127], but received '1641' ---- Begin output of msiexec /qn /i "c:\chef\cache\SharedManagementObjects.msi" IACCEPTSQLNCLILICENSETERMS=YES ---- STDOUT: STDERR: ---- End output of msiexec /qn /i "c:\chef\cache\SharedManagementObjects.msi" IACCEPTSQLNCLILICENSETERMS=YES ---- Ran msiexec /qn /i "c:\chef\cache\SharedManagementObjects.msi" IACCEPTSQLNCLILICENSETERMS=YES returned 1641
'

Moving collaborators to a group

I've created a collaborators group for this cookbooks and moved @scarolan and @jerrelblankenship (whom we need to add to the maintainers doc). This will let maintainers get pinged by issues against this project.

I'm going to remove the individual collaborators next week.

exit code -2067529716 when installing sql server 2016 from mounted iso

Cookbook version

5.5.0

Chef-client version

13.2.20

Platform Details

WindowsBuildLabEx : 14393.2007.amd64fre.rs1_release.171231-1800
WindowsCurrentVersion : 6.3
WindowsEditionId : ServerDatacenter
WindowsInstallationType : Server
WindowsInstallDateFromRegistry : 3/16/2018 1:54:01 PM
WindowsProductId : 00376-50575-80580-AA013
WindowsProductName : Windows Server 2016 Datacenter

Scenario:

I am trying to install sql server 2016 using this cookbook

Steps to Reproduce:

  1. Wrote a wrapper cookbook [cs_sql] with recipe that includes sql_server::server.
    Wrapper attributes defined:
    default['sql_server']['server_sa_password'] = 'Supersecurepassword123'
    default['sql_server']['agent_account_pwd'] = 'Supersecurepassword123'
    default['sql_server']['rs_account_pwd'] = 'Supersecurepassword123'
    default['sql_server']['sql_account_pwd'] = 'Supersecurepassword123'
    default['sql_server']['server']['url'] = 'C:\00.Install\SQL Server 2016 Enterprise Core\Installer\Setup.exe'
    default['sql_server']['server']['checksum'] = '44378B42A9D9620BEAFAA33B09C57E5E24BBC27C14514792319FB385A8A4F7A7'
    default['sql_server']['server']['package_name'] = 'SQL Server 2016 Enterprise Core'

  2. populated attributes in sql_server::server
    -configurationfile.ini is being produced and can be used manually to install.

  3. cd to c:\chef\cookbooks in elevated ps
    -mount my iso
    -['sql_server']['server']['url'] received the path to the setup.exe
    -execute the wrapper:
    chef-client -z -o cs_sql::default

Expected Result:

chef successfully silently installs sql server 2016 using the configuration file.

Actual Result:

Expected process to exit with [0, 42, 127, 3010], but received '-2067529716'

Also tried:
-copy mounted iso contents to local c:\drive and same issue/error
-.net 4.5 is installed
-symantec endpoint protection is installed on my server
-can edit server.rb recipe options /q --> /qs, install stops at first screen does not proceed to installation screen, ACTIONS="Install" in config file.

Here is the output from my latest execution:
PS C:\chef\cookbooks> chef-client -z -o cs_sql::default
[2018-05-15T15:04:08-04:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 13.2.20
[2018-05-15T15:04:12-04:00] WARN: Run List override has been provided.
[2018-05-15T15:04:12-04:00] WARN: Run List override has been provided.
[2018-05-15T15:04:12-04:00] WARN: Original Run List: [recipe[cs_windows_enableuac::enable_uac]]
[2018-05-15T15:04:12-04:00] WARN: Original Run List: [recipe[cs_windows_enableuac::enable_uac]]
[2018-05-15T15:04:12-04:00] WARN: Overridden Run List: [recipe[cs_sql::default]]
[2018-05-15T15:04:12-04:00] WARN: Overridden Run List: [recipe[cs_sql::default]]
resolving cookbooks for run list: ["cs_sql::default"]
Synchronizing Cookbooks:

  • cs-sql (0.1.0)
  • sql_server (5.5.0)
  • windows (3.0.5)
  • ohai (5.2.2)
    Installing Cookbook Gems:
    Compiling Cookbooks...
    Converging 8 resources
    Recipe: sql_server::server
  • template[C:\Users\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini] action create (up to date)

  • windows_package[SQL Server 2016 Enterprise Core] action install

    ================================================================================
    Error executing action install on resource 'windows_package[SQL Server 2016 Enterprise Core]'

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0, 42, 127, 3010], but received '-2067529716'
    ---- Begin output of start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /Config
    urationFile=C:\Users\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123
    " /RSSVCPASSWORD="Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% ----
    STDOUT:
    STDERR:
    ---- End output of start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /Configur
    ationFile=C:\Users\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123"
    /RSSVCPASSWORD="Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% ----
    Ran start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /ConfigurationFile=C:\Us
    ers\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123" /RSSVCPASSWORD=
    "Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% returned -2067529716

    Resource Declaration:

    In C:/Users/amjsaxbu/.chef/local-mode-cache/cache/cookbooks/sql_server/recipes/server.rb

    68: package package_name do
    69: source package_url
    70: checksum package_checksum
    71: timeout node['sql_server']['server']['installer_timeout']
    72: installer_type :custom
    73: options "/q /ConfigurationFile=#{config_file_path} #{passwords_options}"
    74: action :install
    75: notifies :request_reboot, 'reboot[sql server install]'
    76: returns [0, 42, 127, 3010]
    77: end
    78:

    Compiled Resource:

    Declared in C:/Users/amjsaxbu/.chef/local-mode-cache/cache/cookbooks/sql_server/recipes/server.rb:68:in `from_file

'

windows_package("SQL Server 2016 Enterprise Core") do
  package_name "SQL Server 2016 Enterprise Core"
  action [:install]
  default_guard_interpreter :default
  declared_type :package
  cookbook_name "sql_server"
  recipe_name "server"
  source "c:\\00.install\\sql server 2016 enterprise core\\installer\\setup.exe"
  checksum "44378B42A9D9620BEAFAA33B09C57E5E24BBC27C14514792319FB385A8A4F7A7"
  timeout 3500
  installer_type :custom
  options "/q /ConfigurationFile=C:\\Users\\amjsaxbu\\.chef\\local-mode-cache\\cache\\ConfigurationFile.ini /AGTSVCP

ASSWORD="Supersecurepassword123" /RSSVCPASSWORD="Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123""
returns [0, 42, 127, 3010]
end

System Info:
------------
chef_version=13.2.20
platform=windows
platform_version=10.0.14393
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x64-mingw32]
program_name=C:/opscode/chef/bin/chef-client
executable=C:/opscode/chef/bin/chef-client

Running handlers:
[2018-05-15T15:04:17-04:00] ERROR: Running exception handlers
[2018-05-15T15:04:17-04:00] ERROR: Running exception handlers
Running handlers complete
[2018-05-15T15:04:17-04:00] ERROR: Exception handlers complete
[2018-05-15T15:04:17-04:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 08 seconds
[2018-05-15T15:04:17-04:00] FATAL: Stacktrace dumped to C:/Users/amjsaxbu/.chef/local-mode-cache/cache/chef-stacktrace.o
ut
[2018-05-15T15:04:17-04:00] FATAL: Stacktrace dumped to C:/Users/amjsaxbu/.chef/local-mode-cache/cache/chef-stacktrace.o
ut
[2018-05-15T15:04:17-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-15T15:04:17-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-15T15:04:17-04:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_package[SQL Server 2016 Enterprise Core
] (sql_server::server line 68) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42,
127, 3010], but received '-2067529716'
---- Begin output of start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /Configurat
ionFile=C:\Users\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123" /R
SSVCPASSWORD="Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% ----
STDOUT:
STDERR:
---- End output of start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /Configuratio
nFile=C:\Users\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123" /RSS
VCPASSWORD="Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% ----
Ran start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /ConfigurationFile=C:\Users
amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123" /RSSVCPASSWORD="Sup
ersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% returned -2067529716
[2018-05-15T15:04:17-04:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_package[SQL Server 2016 Enterprise Core
] (sql_server::server line 68) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42,
127, 3010], but received '-2067529716'
---- Begin output of start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /Configurat
ionFile=C:\Users\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123" /R
SSVCPASSWORD="Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% ----
STDOUT:
STDERR:
---- End output of start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /Configuratio
nFile=C:\Users\amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123" /RSS
VCPASSWORD="Supersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% ----
Ran start "" /wait "c:\00.install\sql server 2016 enterprise core\installer\setup.exe" /q /ConfigurationFile=C:\Users
amjsaxbu.chef\local-mode-cache\cache\ConfigurationFile.ini /AGTSVCPASSWORD="Supersecurepassword123" /RSSVCPASSWORD="Sup
ersecurepassword123" /SQLSVCPASSWORD="Supersecurepassword123" & exit %%%%ERRORLEVEL%%%% returned -2067529716

README.md clarification regarding SA Password

Hi there

Firstly thanks for working on this cookbook, I hope it will save me a lot of time in the future :)

Could like to clarifiy a point in the README.md

The installation is done using the package resource and ConfigurationFile generated from a template resource. The installation is slightly opinionated and does the following:

    Enables Mixed Mode (Windows Authentication and SQL Server Authentication) authentication
    Auto-generates and sets a strong password for the 'sa' account
    sets a static TCP port which is configurable via an attribute, using the sql_server::configure recipe.

I can't seem to see where the SA password is being generated, is that the case? or should this be removed from the readme?

Thanks again

Best Regards

Gary

After failed SQL Server install, a 2nd run fails because ConfigurationFile.ini already exists

   ================================================================================
   Error executing action `create` on resource 'template[\tmp\kitchen\cache\ConfigurationFile.ini]'
   ================================================================================

   Chef::Exceptions::Win32APIError
   -------------------------------
   The system cannot find the path specified.
   ---- Begin Win32 API output ----
   System Error Code: 3
   System Error Message: The system cannot find the path specified.
   ---- End Win32 API output ----

   Resource Declaration:
   ---------------------
   # In C:/tmp/kitchen/cache/cookbooks/sql_server/recipes/server.rb

    38: template config_file_path do
    39:   source "ConfigurationFile.ini.erb"
    40: end
    41: 

   Compiled Resource:

   ------------------
   # Declared in C:/tmp/kitchen/cache/cookbooks/sql_server/recipes/server.rb:38:in `from_file'

   template("\tmp\kitchen\cache\ConfigurationFile.ini") do
     provider Chef::Provider::Template
     action "create"
     retries 0
     retry_delay 2
     guard_interpreter :default
     path "\\tmp\\kitchen\\cache\\ConfigurationFile.ini"
     backup 5
     atomic_update true
     source "ConfigurationFile.ini.erb"
     cookbook_name "sql_server"
     recipe_name "server"
   end

The required IACCEPTMSODBCSQLLICENSETERMS=YES command-line parameter is missing.

Cookbook version

5.5.0

Chef-client version

14.11.21

Platform Details

Windows Server 2016 connecting to SQL Server 2016 on another host.

Scenario:

Cannot install SQL Server Native Client as the terms constant for the MsiExec installer are not the same as in the recipe\client.rb file.

Steps to Reproduce:

Created a cookbook with a dependency on the sql_server cookbook via metadata.rb.

Added Attributes:

default['sql_server']['accept_eula'] = 'true'

default['sql_server']['native_client']['url'] = Addressable::URI.convert_path( File.join( Chef::Config[:file_cache_path], 'cookbooks', 'otbo_sql_server', 'files', 'default', 'msodbcsql.msi' ) ).to_s.gsub(/#/, '%23')
default['sql_server']['native_client']['checksum'] = '9f21af4bd88c25fa4c4a8763eb81c1a5f92af20cbf2f2391a2293da2bca90cdf'
default['sql_server']['native_client']['package_name'] = 'Microsoft SQL Server - Native Client'

default['sql_server']['command_line_utils']['url'] = Addressable::URI.convert_path( File.join( Chef::Config[:file_cache_path], 'cookbooks', 'otbo_sql_server', 'files', 'default', 'MsSqlCmdLnUtils.msi' ) ).to_s.gsub(/#/, '%23')
default['sql_server']['command_line_utils']['checksum'] = '9479810a2ea8954e0cacd3d47fe0bcb81647b9cfb5efd6ab79b76a6ccadcefe7'
default['sql_server']['command_line_utils']['package_name'] = 'Microsoft SQL Server - Command Line Tools'

Recipe simply calls through to sql_server::client cookbook via include_recipe.

include_recipe 'sql_server::client'

Expected Result:

Successful installation of SQL Server Native Client and SQL Server Command Line Utilities.

Actual Result:

myhost Recipe: sql_server::client
myhost   * windows_package[Microsoft SQL Server - Native Client] action install[2019-04-09T16:00:26+01:00] INFO: Processing windows_package[Microsoft SQL Server - Native Client] action install (sql_server::client line 29)
myhost
myhost   Recipe: <Dynamically Defined Resource>
myhost     * remote_file[c:\chef\cache\package\msodbcsql.msi] action create[2019-04-09T16:00:26+01:00] INFO: Processing remote_file[c:\chef\cache\package\msodbcsql.msi] action create (dynamically defined)
myhost  (up to date)
myhost
myhost
myhost     ================================================================================
myhost     Error executing action `install` on resource 'windows_package[Microsoft SQL Server - Native Client]'
myhost     ================================================================================
myhost
myhost     Mixlib::ShellOut::ShellCommandFailed
myhost     ------------------------------------
myhost     Expected process to exit with [0], but received '1603'
myhost     ---- Begin output of msiexec /qn /i "c:\chef\cache\package\msodbcsql.msi"  IACCEPTSQLNCLILICENSETERMS=YES ----
myhost     STDOUT:
myhost     STDERR:
myhost     ---- End output of msiexec /qn /i "c:\chef\cache\package\msodbcsql.msi"  IACCEPTSQLNCLILICENSETERMS=YES ----
myhost     Ran msiexec /qn /i "c:\chef\cache\package\msodbcsql.msi"  IACCEPTSQLNCLILICENSETERMS=YES returned 1603
myhost
myhost     Resource Declaration:
myhost     ---------------------
myhost     # In c:/chef/cache/cookbooks/sql_server/recipes/client.rb
myhost
myhost      29:   package node['sql_server'][pkg]['package_name'] do # ~FC009
myhost      30:     source node['sql_server'][pkg]['url']
myhost      31:     checksum node['sql_server'][pkg]['checksum']
myhost      32:     installer_type :msi
myhost      33:     options "IACCEPTSQLNCLILICENSETERMS=#{node['sql_server']['accept_eula'] ? 'YES' : 'NO'}"
myhost      34:     action :install
myhost      35:   end
myhost      36: end
myhost
myhost     Compiled Resource:
myhost     ------------------
myhost     # Declared in c:/chef/cache/cookbooks/sql_server/recipes/client.rb:29:in `block in from_file'
myhost
myhost     windows_package("Microsoft SQL Server - Native Client") do
myhost       package_name "Microsoft SQL Server - Native Client"
myhost       action [:install]
myhost       default_guard_interpreter :default
myhost       declared_type :package
myhost       cookbook_name "sql_server"
myhost       recipe_name "client"
myhost       installer_type :msi
myhost       source "file:///c:/chef/cache/cookbooks/otbo_sql_server/files/default/msodbcsql.msi"
myhost       options "IACCEPTSQLNCLILICENSETERMS=YES"
myhost       checksum "9f21af4bd88c25fa4c4a8763eb81c1a5f92af20cbf2f2391a2293da2bca90cdf"
myhost       version "12.2.5543.11"
myhost     end
myhost
myhost     System Info:
myhost     ------------
myhost     chef_version=14.11.21
myhost     platform=windows
myhost     platform_version=10.0.14393
myhost     ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
myhost     program_name=C:/opscode/chef/bin/chef-client
myhost     executable=C:/opscode/chef/bin/chef-client
myhost
myhost [2019-04-09T16:00:26+01:00] INFO: Running queued delayed notifications before re-raising exception
myhost
myhost Running handlers:
myhost [2019-04-09T16:00:26+01:00] ERROR: Running exception handlers
myhost Running handlers complete
myhost [2019-04-09T16:00:26+01:00] ERROR: Exception handlers complete
myhost Chef Client failed. 6 resources updated in 02 minutes 08 seconds
myhost [2019-04-09T16:00:26+01:00] INFO: Sending resource update report (run-id: bcc567ca-2b58-4dec-97ef-c069b761e8b5)
myhost [2019-04-09T16:00:26+01:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
myhost [2019-04-09T16:00:26+01:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
myhost [2019-04-09T16:00:26+01:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_package[Microsoft SQL Server - Native Client] (sql_server::client line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1603'
myhost ---- Begin output of msiexec /qn /i "c:\chef\cache\package\msodbcsql.msi"  IACCEPTSQLNCLILICENSETERMS=YES ----
myhost STDOUT:
myhost STDERR:
myhost ---- End output of msiexec /qn /i "c:\chef\cache\package\msodbcsql.msi"  IACCEPTSQLNCLILICENSETERMS=YES ----
myhost Ran msiexec /qn /i "c:\chef\cache\package\msodbcsql.msi"  IACCEPTSQLNCLILICENSETERMS=YES returned 1603
ERROR: Failed to execute command on myhost return code 1

Further investigation shows that the provided IACCEPTSQLNCLILICENSETERMS=YES is incorrect as it should be IACCEPTMSODBCSQLLICENSETERMS=YES

Action start 16:16:11: SNAC_IAcceptMSODBCSQLLicenseTerms.
MSI (s) (C4:04) [16:16:11:832]: Product: Microsoft ODBC Driver 11 for SQL Server -- The required IACCEPTMSODBCSQLLICENSETERMS=YES command-line parameter is missing. By specifying this parameter, you acknowledge that you accept the end user license terms for the Microsoft ODBC Driver 11 for SQL Server.

The required IACCEPTMSODBCSQLLICENSETERMS=YES command-line parameter is missing. By specifying this parameter, you acknowledge that you accept the end user license terms for the Microsoft ODBC Driver 11 for SQL Server.
Action ended 16:16:11: SNAC_IAcceptMSODBCSQLLicenseTerms. Return value 3.
Action ended 16:16:11: INSTALL. Return value 3.

You cannot install the Command Line Utilities without the ODBC drivers.

MSI (s) (E8:5C) [16:32:58:425]: Product: Microsoft Command Line Utilities 13 for SQL Server -- Setup is missing an installation prerequisite:
 -Microsoft ODBC Driver 11 for SQL Server. To continue, install Microsoft ODBC Driver 11 for SQL Server and 
then run the Setup operation again

The Microsoft website also states "there is no SQL Server 2016 Native Client." (https://docs.microsoft.com/en-us/sql/relational-databases/native-client/applications/installing-sql-server-native-client?view=sql-server-2017)

OpenService: The specified service does not exist as an installed service.

I am trying to install an sqlserver 2012 express version on an windows 2012R2 server. So I have created a wrapper cookbook and i have overridden the instance name.

The installation seems good until line 75 in the server.rb recipe, that is causing the the following error:

Error executing action restart on resource 'windows_service[instance_name]'
SystemCallError
The specified service does not exist as an installed service. - OpenService: The specified service does not exist as an installed service.

Here is the Compiled Resource trace:

windows_service("instance_name") do
    action [:nothing]
    supports {:restart=>nil, :reload=>nil, :status=>nil}
    retries 0
    retry_delay 2

    default_guard_interpreter :default
    service_name "instance_name"
    pattern "instance_name"
    startup_type :automatic
    declared_type :service
    cookbook_name :sql_server
    recipe_name "server"
end

I think that the service_name must always be: service_name = "MSSQL$#{node['sql_server']
['instance_name']}" and not only if it's default SQLEXPRESS value.

SQL Server does not support remote installation over WinRM. For example, the installation fails when you run knife bootstrap windows winrm or knife winrm 'chef-client' with a run-list that includes server.rb. However, you can use a scheduled task or run chef-client as a service

Cookbook version

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

Chef-client version

[Version of chef-client in your environment]

Platform Details

[Operating system distribution and release version. Cloud provider if running in the cloud]

Scenario:

[What you are trying to achieve and you can't?]

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]

Failure when specifying multiple sysadmin names

The cookbook fails if you provide multiple sysadmin names. For example:

default['sql_server']['sysadmins'] = ['Administrator', 'Thomas']

generates "Administrator Thomas" in the Configuration.ini file. SQL Server fails to install because there is no user named "Administrator Thomas".

The correct behavior should generate "Administrator" "Thomas". That is, each account name in double quotes, and space-separated.

This is old, but it's a reference:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/02b0237c-9fd9-46d2-b240-30e95cfa34e0/sqlsysadminaccounts-syntax-for-multiple-account-usage-during-configurationfile-based-installation?forum=sqlsetupandupgrade

error on line 96 of server.rb

Cookbook version

2.6.2

Chef-client version

12.10.24

Platform Details

Win 2012 R2

Scenario:

I managed to install windows feature and now I am running a cookbook to install sql server express on the windows server

Steps to Reproduce:

I have a recipe where I added the following:
include_recipe 'sql_server::server'
when I run the chef-client on the server, I get the following output indicating error on line 96 of the server.rb as you can notice in the Actual results

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]

Expected Result:

sql express successful setup

Actual Result:

Recipe:

  • remote_file[c:\chef\cache\package\SQLEXPR_x64_ENU.exe] action create[2016-06-14T16:35:57+02:00] INFO: Processing r
    mote_file[c:\chef\cache\package\SQLEXPR_x64_ENU.exe] action create (dynamically defined)
    (up to date)

    ←[0m

    Error executing action install on resource 'windows_package[Microsoft SQL Server 2012 (64-bit)]'

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0, 42, 127, 3010], but received '-2068578304'
    ---- Begin output of start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe" /q /ConfigurationFile=c:\chef\cach
    \ConfigurationFile.ini & exit %%%%ERRORLEVEL%%%% ----
    STDOUT:
    STDERR:
    ---- End output of start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe" /q /ConfigurationFile=c:\chef\cache
    onfigurationFile.ini & exit %%%%ERRORLEVEL%%%% ----
    Ran start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe" /q /ConfigurationFile=c:\chef\cache\ConfigurationFi
    e.ini & exit %%%%ERRORLEVEL%%%% returned -2068578304

    Resource Declaration:

    In c:/chef/cache/cookbooks/sql_server/recipes/server.rb

    96: windows_package package_name do
    97: source package_url
    98: checksum package_checksum
    99: timeout node['sql_server']['server']['installer_timeout']
    100: installer_type :custom
    101: options "/q /ConfigurationFile=#{config_file_path} #{passwords_options}"
    102: action :install
    103: notifies :request_reboot, 'reboot[sql server install]'
    104: returns [0, 42, 127, 3010]
    105: end
    106:

    Compiled Resource:

    Declared in c:/chef/cache/cookbooks/sql_server/recipes/server.rb:96:in `from_file'

    windows_package("Microsoft SQL Server 2012 (64-bit)") do
    provider Chef::Provider::Package::Windows
    action [:install]
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    declared_type :windows_package
    cookbook_name "sql_server"
    recipe_name "server"
    source "http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLEXPR_x64_ENU.
    xe"
    checksum "7f5e3d40b85fba2da5093e3621435c209c4ac90d34219bab8878e93a787cf29f"
    timeout 1500
    installer_type :custom
    options "/q /ConfigurationFile=c:\chef\cache\ConfigurationFile.ini "
    success_codes [0, 42, 127, 3010]
    package_name "Microsoft SQL Server 2012 (64-bit)"
    end

    Platform:

    x64-mingw32

2016-06-14T16:37:47+02:00] INFO: Running queued delayed notifications before re-raising exception
[0m
unning handlers:
2016-06-14T16:37:47+02:00] ERROR: Running exception handlers
unning handlers complete
2016-06-14T16:37:47+02:00] ERROR: Exception handlers complete
hef Client failed. 1 resources updated in 02 minutes 31 seconds
2016-06-14T16:37:48+02:00] INFO: Sending resource update report (run-id: 949916c5-ccbe-4b12-9c6e-fb57b81c2628)
2016-06-14T16:37:48+02:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
2016-06-14T16:37:48+02:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
2016-06-14T16:37:48+02:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_package[Microsoft SQL Server 2012 (64-b
t)](sql_server::server line 96) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0,
2, 127, 3010], but received '-2068578304'
--- Begin output of start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe" /q /ConfigurationFile=c:\chef\cache\Co
figurationFile.ini & exit %%%%ERRORLEVEL%%%% ----
TDOUT:
TDERR:
--- End output of start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe" /q /ConfigurationFile=c:\chef\cache\Conf
gurationFile.ini & exit %%%%ERRORLEVEL%%%% ----
an start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe" /q /ConfigurationFile=c:\chef\cache\ConfigurationFile.i
i & exit %%%%ERRORLEVEL%%%% returned -2068578304

SQL 2016

Cookbook version

version '5.3.2'

Chef-client version

Chef: 13.4.19

Platform Details

azure windows 2012-r2 and 2016 datacenter

Scenario:

Trying to install SQL 2016 using this cookbook as a wrapper. It installs the SQL 2016 fine, however kitchen action fails during reboot process. It seems to only happen when trying to install SQL2016.
I even included this in my .kitchen.yml;
retry_on_exit_code:
- 35
max_retries: 1
wait_for_retry: 360
client_rb:
exit_status: :enabled
client_fork: false

Besides the SQL 2016, I am installing SSMS and it seems to install successfully as well.

Steps to Reproduce:

Might need to run the SQL_Server cookbook as a wrapper cookbook and try to install SQL 2016

Expected Result:

Kitchen should return success after reboot. After reboot[sql server install] action request_reboot (sql_server::server line 80).

Actual Result:

I get this error;
"Message: Failed to complete #converge action: [A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) for "52.250.126.103" port 5985 (52.250.126.103:5985)]"

Not able to find the Installation Media folder while installing SQL Server 2012

Cookbook version

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

Chef-client version

[Version of chef-client in your environment]
12

Platform Details

[Operating system distribution and release version. Cloud provider if running in the cloud]
windows server 2012

Scenario:

[What you are trying to achieve and you can't?]
Need to get MS SQL Server installed

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
While we run the chef script in converged cloud Automation. by using
Url: https://github.com/chef-cookbooks/sql_server
It got successfully completed. But we go and check the sql server at the VNC machine. We are not able to get it started. It is asking for installation instructions. After following the instructions it is asking for media files and we point to the SQL server but it shows invalid installation path.

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]
Installing SQL Server 2012

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]
Invalid path.

undefined method `short_cksum' when passing checksum

Cookbook version

[2.5.0 and 3]

Chef-client version

[chef-client-12.13.37-1-x64]

Platform Details

[Windows 2012R2. VirtalBox]

Scenario:

[What you are trying to achieve and you can't?]
Trying to install using a local copy of the SQLEXPR_x64_ENU.exe for 2008.
Need to be able to create VM while not connect to the internet.
Passing the attributes in the kitchen.yml file.
attributes:
sql_server:
server:
url: 'C:\Support\vboxsync\SQL_Server\SQLEXPR_x64_ENU_2008.exe'
checksum: "8EBF6BDD805F3326D5B9A35A129AF276C7FE99BFCA64AC0CFE0FFC66311DFE09"
Able to see in the log the file and checksum are picked up.

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
Removed the checksum requirement from the server.rb file
windows_package package_name do
source package_url
checksum package_checksum <-----_removed this line_
timeout node['sql_server']['server']['installer_timeout']
installer_type :custom
options "/q /ConfigurationFile=#{config_file_path} #{passwords_options}"
action :install
end

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]
Expecting SQL 2008 Express Ed to be installed by passing the URL and CheckSum.

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]
Getting this message when running:
undefined method `short_cksum'

Remove support for SQL Server pre-2008 R2 SP2

We have a HUGE number of attributes that we set so we can support every version of SQL Server. We could greatly simplify this by removing support for SQL Server 2008 R2 and 2008 R2 SP1.

Add Support For Failover Clustering

Cookbook version

5.5.0

Chef-client version

13.12.3

Platform Details

Windows Server 2016

Scenario:

Setup Failover Clustering instead of a standalone installation

Expected Result:

A Failover Cluster is configured

Actual Result:

Failover Cluster is unable to be created

The 'tiny_tds' native gem requires installed build tools

I am trying to get SQL 2012 running on a 2012 R2 Core machine. SQL get's installed fine however it exits when trying to install 'tiny_tds' at the end of the server recipe. It is giving the following error:

The 'tiny_tds' native gem requires installed build tools.'

The docs say the following about this.

The TinyTDS gem is also installed as this is used in the SQL Server providers for the database and database_user resources (see the database cookbook for more details).

I'm not really interested in using these providers so I'm wondering if there is a reason why it's being handled in this cookbook as opposed to the database cookbook?

SSMS Latest Version on Sql2016

Chef-client version

13.1.31

Platform Details

Windows 2016 with Sql 2016

Scenario:

Want to install SSMS 17.8 version

Steps to Reproduce:

server_install 'Install SQL Server 2016 Evaluation' do
source_url 'C:\Sources\SQL 2016 Eval\setup.exe'
version '2016'
package_checksum 'checksum for the setup.exe'
accept_eula true
instance_name 'MSSQLSERVER'
feature %w(SQLENGINE SSMS ADV_SSMS)
end

Expected Result:

SSMS should be installed with latest version 17.8

Actual Result:

I want to know whether above recipe will install SSMS 17.8.. I am sure in SQL 2016 SSMS wont install as part of SQL installation and it should be done separately. I need a recipe to install SSMS 17.8 version.

depends "windows", ">= 1.2.6" in metadata.rb file

I addition to this, I have any question what is the significance of depends "windows", ">= 1.2.6" in metadata.rb file and how to get "windows", ">= 1.2.6" cookbook. Could you please help me out with this issue as well.
Hi

I have installation media fro sql server 2012. I installed IIS to host sql server binaries for version 2008 and 2012. I can download them directly from the my IIS website. I didnot understand what is checksum in the cookbook and how to find that value.

Missing ConfigurationFile.ini Attributes

Cookbook version

v5.5.0

Chef-client version

N/A

Platform Details

N/A

Scenario:

Configure MSSQL Developer with required configuration properties.

Steps to Reproduce:

Bootstrap/run kitchen test.

Expected Result:

Configuration properties exist.

Actual Result:

Configurations are not present in the ConfigurationFile.ini.

SQL 2012 installation via Knife Bootstrap fails

Structure:
WindowsServer2012-node (is deployed)
Chef Server (12.2.0, cookbooks are storaged on server)
Windows 7 Workstation (for management)
/attributes/default.rb: one string was changed default['sql_server']['version'] = '2012'

I have a problem with installation SQL 2012 using sql_server 2.4.0 cookbook. When I run chef-client on the node locally, it runs, connects to the chef-server, downloads recipes and installs SQL Server 2012 successfully.

BUT during knife bootstrap using this chef-server, it fails:
WinServ2012 Expected process to exit with [0, 42, 127], but received '-2068578298'

...\chef-repo> knife bootstrap windows winrm WinServ2012 -p 5985 -x 'Login' -P 'Pass' -N Win2012 -r 'recipe[sql_server:server]' -VV
WinServ2012 >chef-client -c c:/chef/client.rb -j c:/chef/first-boot.json
WinServ2012 [2015-10-30T17:24:44+03:00] INFO: *** Chef 12.5.1 ***
WinServ2012 [2015-10-30T17:24:44+03:00] INFO: Chef-client pid: 2636
WinServ2012 [2015-10-30T17:24:57+03:00] INFO: Setting the run_list to ["recipe[sql_server:server]"] from CLI options
WinServ2012 [2015-10-30T17:24:57+03:00] INFO: Run List is [role[adam]]
WinServ2012 [2015-10-30T17:24:57+03:00] INFO: Starting Chef Run for Win2012
WinServ2012 [2015-10-30T17:24:57+03:00] INFO: Running start handlers
WinServ2012 [2015-10-30T17:24:57+03:00] INFO: Start handlers complete.
WinServ2012 [2015-10-30T17:24:57+03:00] INFO: HTTP Request Returned 404 Not Found:
WinServ2012 [2015-10-30T17:24:57+03:00] INFO: Loading cookbooks [[email protected], [email protected], [email protected]
, [email protected], [email protected]]
WinServ2012 [2015-10-30T17:24:58+03:00] INFO: Storing updated cookbooks/sql_server/recipes/server.rb in the cache.
[2015-10-30T17:25:05+03:00] INFO: Processing template[c:\chef\cache\ConfigurationFile.ini] action create
(sql_server::server line 44)
[2015-10-30T17:25:05+03:00] INFO: Processing windows_package[Microsoft SQL Server 2012 (64-bit)] action i
nstall (sql_server::server line 69)
WinServ2012 [2015-10-30T17:25:05+03:00] INFO: Installing windows_package[Microsoft SQL Server 2012 (64-bit)] version
latest
WinServ2012 [2015-10-30T17:25:05+03:00] INFO: Starting installation...this could take awhile.
WinServ2012
WinServ2012
WinServ2012 ================================================================================
WinServ2012 Error executing action `install` on resource 'windows_package[Microsoft SQL Server 2012 (64-bit)]'
WinServ2012 ================================================================================
WinServ2012
WinServ2012 Mixlib::ShellOut::ShellCommandFailed
WinServ2012 ------------------------------------
WinServ2012 Expected process to exit with [0, 42, 127], but received '-2068578298'
WinServ2012 ---- Begin output of start "" /wait "c:\chef\cache\SQLEXPR_x64_ENU.exe" /q /ConfigurationFile=c:\chef\cac
he\ConfigurationFile.ini & exit %%ERRORLEVEL%% ----
WinServ2012 STDOUT:
WinServ2012 STDERR:
WinServ2012 ---- End output of start "" /wait "c:\chef\cache\SQLEXPR_x64_ENU.exe" /q /ConfigurationFile=c:\chef\cache
\ConfigurationFile.ini & exit %%ERRORLEVEL%% ----
WinServ2012 Ran start "" /wait "c:\chef\cache\SQLEXPR_x64_ENU.exe" /q /ConfigurationFile=c:\chef\cache\ConfigurationF
ile.ini & exit %%ERRORLEVEL%% returned -2068578298
WinServ2012
WinServ2012 Cookbook Trace:
WinServ2012 ---------------
WinServ2012 c:/chef/cache/cookbooks/windows/libraries/windows_package.rb:109:in `install_package'
WinServ2012 c:/chef/cache/cookbooks/windows/libraries/windows_package.rb:31:in `block in <class:WindowsCookbookPackag
e>'
WinServ2012
WinServ2012 Resource Declaration:
WinServ2012 ---------------------
WinServ2012 # In c:/chef/cache/cookbooks/sql_server/recipes/server.rb
WinServ2012
WinServ2012  69: windows_package package_name do
WinServ2012  70:   source package_url
WinServ2012  71:   checksum package_checksum
WinServ2012  72:   timeout node['sql_server']['server']['installer_timeout']
WinServ2012  73:   installer_type :custom
WinServ2012  74:   options "/q /ConfigurationFile=#{config_file_path}"
WinServ2012  75:   action :install
WinServ2012  76: end
WinServ2012  77:
WinServ2012
WinServ2012 Compiled Resource:
WinServ2012 ------------------
WinServ2012 # Declared in c:/chef/cache/cookbooks/sql_server/recipes/server.rb:69:in `from_file'
WinServ2012
WinServ2012 windows_package("Microsoft SQL Server 2012 (64-bit)") do
WinServ2012   provider Chef::Provider::WindowsCookbookPackage
WinServ2012   action [:install]
WinServ2012   retries 0
WinServ2012   retry_delay 2
WinServ2012   default_guard_interpreter :default
WinServ2012   declared_type :windows_package
WinServ2012   cookbook_name "sql_server"
WinServ2012   recipe_name "server"
WinServ2012   source "c:\\chef\\cache\\SQLEXPR_x64_ENU.exe"
WinServ2012   checksum "7f5e3d40b85fba2da5093e3621435c209c4ac90d34219bab8878e93a787cf29f"
WinServ2012   timeout 1500
WinServ2012   installer_type :custom
WinServ2012   options "/q /ConfigurationFile=c:\\chef\\cache\\ConfigurationFile.ini"
WinServ2012   package_name "Microsoft SQL Server 2012 (64-bit)"
WinServ2012   success_codes [0, 42, 127]
WinServ2012 end
WinServ2012
WinServ2012
WinServ2012 [2015-10-30T17:25:50+03:00] INFO: Running queued delayed notifications before re-raising exception
WinServ2012 [2015-10-30T17:25:50+03:00] ERROR: Running exception handlers
WinServ2012 [2015-10-30T17:25:50+03:00] ERROR: Exception handlers complete
WinServ2012 [2015-10-30T17:25:50+03:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
WinServ2012 [2015-10-30T17:25:50+03:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_package[Microsoft SQL Se
rver 2012 (64-bit)] (sql_server::server line 69) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to
 exit with [0, 42, 127], but received '-2068578298'
WinServ2012 ---- Begin output of start "" /wait "c:\chef\cache\SQLEXPR_x64_ENU.exe" /q /ConfigurationFile=c:\chef\cac
he\ConfigurationFile.ini & exit %%ERRORLEVEL%% ----
WinServ2012 STDOUT:
WinServ2012 STDERR:
WinServ2012 ---- End output of start "" /wait "c:\chef\cache\SQLEXPR_x64_ENU.exe" /q /ConfigurationFile=c:\chef\cache
\ConfigurationFile.ini & exit %%ERRORLEVEL%% ----
WinServ2012 Ran start "" /wait "c:\chef\cache\SQLEXPR_x64_ENU.exe" /q /ConfigurationFile=c:\chef\cache\ConfigurationF
ile.ini & exit %%ERRORLEVEL%% returned -2068578298
DEBUG: WinServ2012[48E543F2-0475-4B47-92F8-284F8B6F8A6C] => :command_cleanup[cmd.exe /C "%TEMP%\bootstrap-113396-1446
215032.bat"]
DEBUG: WinServ2012[48E543F2-0475-4B47-92F8-284F8B6F8A6C] => :shell_close
ERROR: Bootstrap command returned 1

WindowsServer2012-node event log:

Fault bucket , type 0
Event Name: SQL110Exception
Response: Not available
Cab Id: 0

Problem signature:
P1: SQL Server 2012@RTM@
P2: 0xD0340AF4
P3: 0xBDC89BCB
P4: 0xB8001817@1902@3
P5: 0xBB814387
P6: SearchUpdatesAction
P7: Unknown
P8: 0x8705743E
P9: Unknown
P10: Unknown

Attached files:

These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\Critical_SQL Server 2012@_34b16daed35458e6bdf8adc8d38d55e0776c8cc_00000000_0ba4415e

Analysis symbol: 
Rechecking for solution: 0
Report Id: c615062f-7f11-11e5-80c6-0800270a3845
Report Status: 4100
Hashed bucket: 

Unable to find 'gem' binary in path

While executing recipe[sql_server::client] chef fails (only) at the first execution with Unable to find 'gem' binary in path.

The sql_server cookbook needs to use chef_gem to install the gem into the version of Ruby that Chef is using instead of using gem_package which would install to a version of Rubygems on the system. In this case, there is no rubygems on the system, which is causing the error.

@schisamo https://github.com/opscode-cookbooks/sql_server/blame/master/recipes/client.rb#L45

This may have worked previously on Chef 11 before the embedded\bin directory was removed from the path in Chef 12 in chef-boneyard/omnibus-chef#238.

Enable FileStream

Is there a way to enable file stream using this cookbook?
This has to be done on the OS and the SQL Server

Please make .NET 3.5 optional

I've been playing around with changing to use the resource rather than wrapping the cookbook. However, the setup I'm looking to install with Windows 2016 server with SQL 2016sp1 server doesn't require .NET 3.5 anymore. In fact it's sort of a pain to get things setup correctly with Windows 2016 with .NET 3.5. Anyway, I'd like to request that .NET 3.5 be an optional installation with this SQL server installation.

https://github.com/chef-cookbooks/sql_server/blob/ed6aa040bd1e6a69ab461d1878fd81f46d5c2d56/resources/install.rb#L75

Deprecation warning from server.rb for using windows_package

Cookbook version

2.6.2

Chef-client version

12.11.18

Platform Details

Windows 2012 R2

Scenario:

Running an rspec unit test using the sql_server cookbook results in the deprecation message of
"WARN: Please use the package resource available in Chef Client 12.6.
windows_package will be removed in the next major version release of the Windows cookbook."

Steps to Reproduce:

Create an rspec unit test that uses the sql_server cookbook. Running such a unit test will produce the deprecation message.

Expected Result:

No deprecation message should appear.

Actual Result:

The deprecation message of
"WARN: Please use the package resource available in Chef Client 12.6.
windows_package will be removed in the next major version release of the Windows cookbook."
shows when running the rspec unit test.

Readme broken link

However, you can use a scheduled task or run chef-client as a service. Learn more in this Learn Chef tutorial.

The link gives a 404

Publishing latest version to supermarket

Any word on when the next version will be published to the chef supermarket?

Are there any outstanding bugs that need squashing before this can happen? Maybe I can help

SQLSVCPASSWORD is required

According to Microsofts documentation, SQLSVCPASSWORD is required for unattended setups, yet the cookbook does not validate that the attribute node['sql_server']['sql_account_pwd'] is defined.

Should a check be included to validate that sql_account_pwd is set?

Support for Windows 2016? Fails attempting to remove .net component

Cookbook version

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

Chef-client version

13.8.3

Platform Details

[Operating system distribution and release version. Cloud provider if running in the cloud]
Azure , Windows 2016

Scenario:

[What you are trying to achieve and you can't?]
Deploy SQL 2016 server on Windows 2016

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]

Actual Result:

  • windows (4.1.4)
    [2018-04-11T00:35:07+00:00] INFO: Storing updated cookbooks/sql_server/recipes/default.rb in the cache.
  • sql_server (5.5.0)
    Installing Cookbook Gems:
    Compiling Cookbooks...
    Converging 1 resources
    Recipe: sql_server::default
  • sql_server_install[Install SQL 2014 Express] action install[2018-04-11T00:35:07+00:00] INFO: Processing sql_server_install[Install SQL 2014 Express] action install (sql_server::default line 24)

    • windows_feature[NET-Framework-Features, NET-Framework-Core] action install[2018-04-11T00:35:07+00:00] INFO: Processing windows_feature[NET-Framework-Features, NET-Framework-Core] action install (c:/chef/cache/cookbooks/sql_server/resources/install.rb line 77)

      • windows_feature_powershell[NET-Framework-Features, NET-Framework-Core] action install[2018-04-11T00:35:07+00:00] INFO: Processing windows_feature_powershell[NET-Framework-Features, NET-Framework-Core] action install (c:/chef/cache/cookbooks/windows/resources/feature.rb line 47)

        ================================================================================
        Error executing action install on resource 'windows_feature_powershell[NET-Framework-Features, NET-Framework-Core]'

        RuntimeError

        The Windows feature net-framework-core is have been removed from the host and cannot be installed.

        Cookbook Trace:

        c:/chef/cache/cookbooks/windows/resources/feature_powershell.rb:218:in fail_if_removed' c:/chef/cache/cookbooks/windows/resources/feature_powershell.rb:41:in block in class_from_file'

        Resource Declaration:

        In c:/chef/cache/cookbooks/windows/resources/feature.rb

        47: declare_resource(subresource, new_resource.name) do
        48: action desired_action
        49: feature_name new_resource.feature_name
        50: source new_resource.source if new_resource.source
        51: all new_resource.all
        52: timeout new_resource.timeout
        53: management_tools new_resource.management_tools if subresource == :windows_feature_powershell
        54: end
        55: end

        Compiled Resource:

        Declared in c:/chef/cache/cookbooks/windows/resources/feature.rb:47:in `run_default_subresource'

        windows_feature_powershell("NET-Framework-Features, NET-Framework-Core") do
        action [:install]
        default_guard_interpreter :default
        declared_type :windows_feature_powershell
        cookbook_name "sql_server"
        feature_name ["net-framework-features", "net-framework-core"]
        all false
        timeout 600
        management_tools false
        end

        System Info:

        chef_version=13.8.3
        platform=windows
        platform_version=10.0.14393
        ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]
        program_name=C:/opscode/chef/bin/chef-client
        executable=C:/opscode/chef/bin/chef-client

[2018-04-11T00:35:39+00:00] INFO: Running queued delayed notifications before re-raising exception

  ================================================================================
  Error executing action `install` on resource 'windows_feature[NET-Framework-Features, NET-Framework-Core]'
  ================================================================================

  RuntimeError
  ------------
  windows_feature_powershell[NET-Framework-Features, NET-Framework-Core] (c:/chef/cache/cookbooks/windows/resources/feature.rb line 47) had an error: RuntimeError: The Windows feature net-framework-core is have been removed from the host and cannot be installed.

  Cookbook Trace:
  ---------------
  c:/chef/cache/cookbooks/windows/resources/feature_powershell.rb:218:in `fail_if_removed'
  c:/chef/cache/cookbooks/windows/resources/feature_powershell.rb:41:in `block in class_from_file'

  Resource Declaration:
  ---------------------
  # In c:/chef/cache/cookbooks/sql_server/resources/install.rb

   77:     windows_feature ['NET-Framework-Features', 'NET-Framework-Core'] do
   78:       action :install
   79:       source new_resource.netfx35_source if new_resource.netfx35_source
   80:       install_method :windows_feature_powershell
   81:     end
   82:   end

  Compiled Resource:
  ------------------
  # Declared in c:/chef/cache/cookbooks/sql_server/resources/install.rb:77:in `block in class_from_file'

  windows_feature("NET-Framework-Features, NET-Framework-Core") do
    action [:install]
    default_guard_interpreter :default
    declared_type :windows_feature
    cookbook_name "sql_server"
    install_method :windows_feature_powershell
    feature_name "NET-Framework-Features, NET-Framework-Core"
  end

  System Info:
  ------------
  chef_version=13.8.3
  platform=windows
  platform_version=10.0.14393
  ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]
  program_name=C:/opscode/chef/bin/chef-client
  executable=C:/opscode/chef/bin/chef-client

[2018-04-11T00:35:40+00:00] INFO: Running queued delayed notifications before re-raising exception

================================================================================
Error executing action `install` on resource 'sql_server_install[Install SQL 2014 Express]'
================================================================================

RuntimeError
------------
windows_feature[NET-Framework-Features, NET-Framework-Core] (c:/chef/cache/cookbooks/sql_server/resources/install.rb line 77) had an error: RuntimeError: windows_feature_powershell[NET-Framework-Features, NET-Framework-Core] (c:/chef/cache/cookbooks/windows/resources/feature.rb line 47) had an error: RuntimeError: The Windows feature net-framework-core is have been removed from the host and cannot be installed.

Cookbook Trace:
---------------
c:/chef/cache/cookbooks/windows/resources/feature_powershell.rb:218:in `fail_if_removed'
c:/chef/cache/cookbooks/windows/resources/feature_powershell.rb:41:in `block in class_from_file'

Resource Declaration:
---------------------
# In c:/chef/cache/cookbooks/sql_server/recipes/default.rb

 24: sql_server_install 'Install SQL 2014 Express' do
 25:   version '2014'
 26:   accept_eula true
 27:   instance_name 'Test'
 28: end

Compiled Resource:
------------------
# Declared in c:/chef/cache/cookbooks/sql_server/recipes/default.rb:24:in `from_file'

sql_server_install("Install SQL 2014 Express") do
  action [:install]
  default_guard_interpreter :default
  declared_type :sql_server_install
  cookbook_name "sql_server"
  recipe_name "default"
  version "2014"
  accept_eula true
  instance_name "Test"
end

System Info:
------------
chef_version=13.8.3
platform=windows
platform_version=10.0.14393
ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]
program_name=C:/opscode/chef/bin/chef-client
executable=C:/opscode/chef/bin/chef-client

[2018-04-11T00:35:40+00:00] INFO: Running queued delayed notifications before re-raising exception

Error executing action `start` on resource 'windows_service[SQLAgent$SQLEXPRESS]'

Cookbook version

2.6.2

Chef-client version

12.13.37

Platform Details

Windows Server 2012 R2 running on AWS via Test Kitchen

Scenario:

I'm trying to install SQLServer Express 2012.

Recipe

unless Dir.exist? 'c:/Program Files/Microsoft SQL Server'
  include_recipe 'sql_server::server'

  reboot 'name' do
    action :request_reboot
    reason 'SQL Server installation'
    delay_mins 5
  end
end

Attributes

default['sql_server']['accept_license_terms'] = true
default['sql_server']['server_sa_password'] = 'password'
default['sql_server']['version'] = '2012'
default['sql_server']['agent_startup'] = 'Automatic'

Steps to Reproduce:

Using the IIS and Windows cookbooks I'm doing the following:

  • Enable Windows feature - IIS Web Server Role
  • Enable Windows feature - IIS ASPNET 45
  • Delete default site
  • Create new site and app
  • Grab remote package
  • Include sql_server::server

Expected Result:

I'm expecting a server reboot on the first run when SQL Server 2012 R2 installation completes

Actual Result:

================================================================================
           Error executing action `start` on resource 'windows_service[SQLAgent$SQLEXPRESS]'
           ================================================================================

           SystemCallError
           ---------------
           The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. - StartService: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

           Resource Declaration:
           ---------------------
           # In C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/sql_server/recipes/server.rb

           118:   service agent_service_name do
           119:     action [:start, :enable]
           120:   end
           121: end

           Compiled Resource:
           ------------------
           # Declared in C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/sql_server/recipes/server.rb:118:in `from_file'

           windows_service("SQLAgent$SQLEXPRESS") do
             action [:start, :enable]
             supports {:restart=>nil, :reload=>nil, :status=>nil}
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             service_name "SQLAgent$SQLEXPRESS"
             pattern "SQLAgent$SQLEXPRESS"
             startup_type :automatic
             declared_type :service
             cookbook_name "sql_server"
             recipe_name "server"
           end

           Platform:
           ---------
           x64-mingw32

         * reboot[sql server install] action request_reboot[2016-08-18T15:29:15+00:00] WARN: Reboot requested:'sql server install'

           - request a system reboot to occur if the run succeeds

Providing Examples for installing a different edition of sql

Hi
I am after some advice on how people are preparing the media for installing a none SQL express edition of SQL.
I have the SQL ISO image from Microsoft, so I wondered, are you downloading and extracting that ISO to the node beforehand? Or are you hosting an extracted copy of that media on a web server or unc path?

If anyone would be willing to share a working example of what values they used for node['sql_server']['server']['url'] (which msi are they targeting) and what package_name. I could generalise them and create PR to update the documentation?
Thanks in advance
Gary

how to get checksum value

Hi

I have installation media fro sql server 2012. I installed IIS to host sql server binaries for version 2008 and 2012. I can download them directly from the my IIS website. I didnot understand what is checksum in the cookbook and how to find that value.

SQL 2016 install fails due to registry key unloaded

Cookbook version

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

Chef-client version

[Version of chef-client in your environment]
chef-client 14.12.9-1-x64.msi installed in vm template.
chef-server 14.11.21 with manage

Platform Details

[Operating system distribution and release version. Cloud provider if running in the cloud]
-Windows 2016 DataCenter
-vSphere 6.7.0.30000 machine template.
-vRA 7.5.0 (Build: 10053500)
-Chef Server plug-in for vRealize Orchestrator 1.0.0 - chef/vmware collaboration.
-Default workflow that came with the Chef server plugin - "CHEF\Windows Node Management\VMTools\Windows VMTools Chef-client first run Validatorless workflow"
-SQL Server enterprise core 2016

Scenario:

[What you are trying to achieve and you can't?]
Execute vRA request which provisions a VM and then calls the vRO chef plugin workflow to add the provisioned VM to Chef server as a client and node (which occurs successfully) and then execute a runlist containing this cookbook to install sql server 2016 enterprise core.

Insallation fails with the following errors:

1.SQL core installer complains about WMI service cannot be started. There are COM+ registry errors in the windows event viewer at the exact time or just seconds before associated with my local administrator AD domain account not having permissions to the runtimebroker com+ application. The event viewer also shows that the SQL Server ScenarioEngine.exe registry keys in use leaked, which results in windows closing the handle before SQL Server ScenarioEngine.exe is done using it for the install.

  1. "SQL Server Setup was not able to access domain 'WinNT://XXXX' to validate user account 'XXXXX'. The SQL Server service account login or password is not valid.” However, the service account password is correct and validated using run as powershell credentials test running notepad or some other app as that user. SQL installer is trying to connect to AD via the runtimebroker COM+ app to validate the service account the SQL configuration.ini unattend file is setting on the windows sql services, but cannot access runtimebroker due to the registry unloading the key necessary as indicated in the error above. It seems to pretty consistently alternate between these 2 errors. I can run it and get WMI error, then run again and get user account access error, then run again and get WMI, then run again and get user account access error.

  2. I occasionally will get "could not read key from registry" without getting either of the first 2 errors.

IF I login to the VM prior to the server.rb recipe running as the local admin AD domain user account chef is running the cookbook under, the sql installer completes successfully without errors.

IF set the security policy "do not forcefully unload registry when user logs off" in the registry of the template, or via a reg key resource before the package resource in the server.rb recipe, the installation completes successfully without errors.

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
I am only using the server.rb and configure.rb recipes from the sql_server cookbook. I have commented out options that we don't need in the server.rb recipe, and had to change the OPTIONS string to the following for it to work:
"/Q /ACTION=#{node['cs_sql_server']['setup_action']} #{passwords_options} /ConfigurationFile=#{config_file_path} /IAcceptSQLServerLicenseTerms=#{node['cs_sql_server']['accept_eula']}"

I added 2 custom recipes, one to run first which bootstraps the vm with custom applications, then server.rb followed by configure.rb, followed by custom recipe to execute my custom apps.

ALL recipes run successfully and complete without issue when executed via chef-solo command logged into the vm as admin.

  1. I have a windows template in vSphere that contains the chef-client installed.
  2. vRA blueprint clones the template and powers on, joins domain, adds local users specified to admins, updates vmtools.
  3. vRA executes the vRO Chef Server plug-in for vRealize Orchestrator's default worklfow named "CHEF\Windows Node Management\PowerShell\Windows PS Chef-client first run Validatorless workflow" and passes required parameters.
  4. The workflow successfully executes my custom recipe first and then server.rb
  5. Server.rb completes with errors.
  6. Login and review SQL installation logs to find the errors listed above.

IF I login to the VM prior to the server.rb recipe running as the local admin AD domain user account chef is running the cookbook under, the sql installer completes successfully without errors.

IF set the security policy "do not forcefully unload registry when user logs off" in the registry of the template, or via a reg key resource before the package resource in the server.rb recipe, the installation completes successfully without errors.

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]
I expect the sql installer to error with the errors indicated.

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]

DCOM errors at the time of the sql install error in the logs:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID 
{D63B10C5-BB46-4990-A94F-E40B9D520160}
and APPID 
{9CA88EE3-ACB7-47C8-AFC4-AB702511C276}
to the user DOMAIN\USER SID (S-1-5-21-221447426-1814128558-2251880862-1653) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.

Registry key leaked event viewer errors:
`Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards. No user action is required.

DETAIL -
11 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Policies
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Internet Explorer\Main
Process 2836 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\setup.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows NT\CurrentVersion
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\Control Panel\International
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Internet Explorer\Security
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap

1 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653_Classes:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653_Classes

1 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows NT\CurrentVersion

2 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653_Classes:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653_Classes
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653_Classes
`

SQL install log errors:
`C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\Detail.txt
(01) 2019-05-09 10:44:04 Slp: Running Action: ValidateSettingsAgainstScenario
(01) 2019-05-09 10:44:04 Slp: Scenario: Install
(01) 2019-05-09 10:44:04 Slp: Completed Action: ValidateSettingsAgainstScenario, returned True
(01) 2019-05-09 10:44:04 Slp: ----------------------------------------------------------------------
(01) 2019-05-09 10:44:04 Slp: Running Action: FinalCalculateSettings
(06) 2019-05-09 10:44:04 Slp: The directory monitor thread is interrupted due to the following exception while monitoring the notifications for directory 'C:\Program Files (x86)'
(06) 2019-05-09 10:44:04 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
(06) 2019-05-09 10:44:04 Slp: Inner exceptions are being indented
(06) 2019-05-09 10:44:04 Slp:
(06) 2019-05-09 10:44:04 Slp: Exception type: Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException
(06) 2019-05-09 10:44:04 Slp: Message:
(06) 2019-05-09 10:44:04 Slp: The directory monitor thread is interrupted. Message: 'The directory monitor thread is interrupted due to a StopMonitor call.'
(06) 2019-05-09 10:44:04 Slp: HResult : 0x86a40016
(06) 2019-05-09 10:44:04 Slp: FacilityCode : 1700 (6a4)
(06) 2019-05-09 10:44:04 Slp: ErrorCode : 22 (0016)
(06) 2019-05-09 10:44:04 Slp: Data:
(06) 2019-05-09 10:44:04 Slp: ErrorMessage = The directory monitor thread is interrupted due to a StopMonitor call.
(06) 2019-05-09 10:44:04 Slp: WatsonData = Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException@22
(06) 2019-05-09 10:44:04 Slp: Stack:
(06) 2019-05-09 10:44:04 Slp: at Microsoft.SqlServer.Configuration.Sco.DirectoryMonitor.Monitor()

……..
(01) 2019-05-09 10:44:04 Slp: Initializing rule : Windows Management Instrumentation (WMI) service
(01) 2019-05-09 10:44:04 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:04 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.WmiServiceInfo
(01) 2019-05-09 10:44:05 Slp: Cluster Service is not running : Exception is as follows System.Runtime.InteropServices.COMException (0x80040150): Could not read key from registry

at System.Management.ThreadDispatch.Start()
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.SqlServer.Configuration.SetupExtension.WmiServiceInfo.Microsoft.SqlServer.Configuration.RulesEngineExtension.IRuleInitialize.Init(String ruleId)
at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.Execute(Boolean stopOnFailure)
(01) 2019-05-09 10:44:05 Slp: Rule initialization failed - hence the rule result is assigned as Failed
(01) 2019-05-09 10:44:05 Slp: Initializing rule : Consistency validation for SQL Server registry keys
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.AclPermissionsFacet
(01) 2019-05-09 10:44:05 Slp: Launching external tool: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x64.exe
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(08) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server - Set SE_DACL_AUTO_INHERITED.
(08) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\130 - Set SE_DACL_AUTO_INHERITED.
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(01) 2019-05-09 10:44:05 Slp: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x64.exe exit code: 0
(01) 2019-05-09 10:44:05 Slp: Launching external tool: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x86.exe
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(09) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server - OK.
(09) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\130 - OK.
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(01) 2019-05-09 10:44:05 Slp: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x86.exe exit code: 0
(01) 2019-05-09 10:44:05 Slp: Rule 'AclPermissionsFacet' detection result: AreSqlAclPermissionsCanonical= True
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : AclPermissionsFacet
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: SQL Server registry keys are consistent and can support SQL Server installation or upgrade.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : Long path names to files on SQL Server installation media
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.MediaPathLenghtFacet
(01) 2019-05-09 10:44:05 Slp: Rule 'MediaPathLength' INSTALLMEDIAPATH length is 56
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : MediaPathLength
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: The SQL Server installation media is not too long.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : SQL Server Setup Product Incompatibility
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.SetupCompatibilityCheck
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\Microsoft SQL Server\130\Bootstrap\Incompatibilities
(01) 2019-05-09 10:44:05 Slp: Searching for reg path SOFTWARE\Microsoft\Microsoft SQL Server\130\Bootstrap\Incompatibilities. Open subkey result is False
(01) 2019-05-09 10:44:05 Slp: Regkey not present. No incompatibilities
(01) 2019-05-09 10:44:05 Slp: Incompatibility detected = False
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : SetupCompatibilityCheck
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: Setup has not detected any incompatibilities.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : .NET 2.0 and .NET 3.5 Service Pack 1 update for Windows 2008 R2 and Windows 7 (KB958488)
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.NoRebootPackageFacet
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : NoRebootPackage
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: This computer has the required update package.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : Edition WOW64 platform
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.FacetWOW64PlatformCheck
(01) 2019-05-09 10:44:05 Slp: Current machineArchitecture = x64
(01) 2019-05-09 10:44:05 Slp: Setup package is 64 bit, Marking check for WOW Supported32bitSetup as passed
(01) 2019-05-09 10:44:05 Slp: Current machineArchitecture is 64bit
(01) 2019-05-09 10:44:05 Slp: Rule 'FacetWOW64PlatformCheck' results: Supported32bitSetup=True
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : FacetWOW64PlatformCheck
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: SQL Server Setup is supported on this operating system platform.
(01) 2019-05-09 10:44:05 Slp: Saved to directory.......C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\SystemConfigurationCheck_Report.htm
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to create directory C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to create directory C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources, security descriptor
(01) 2019-05-09 10:44:05 Slp: Sco: Directory 'C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources' already exists, skipping creation, moving to set security descriptor.
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to set security descriptor for directory C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources, security descriptor
(01) 2019-05-09 10:44:05 Slp: Sco: SDDL is NULL/empty and overwriteSecurityDescriptor is false, so nothing to do, return.
(01) 2019-05-09 10:44:05 Slp: Rules evaluation report is available now at C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\SystemConfigurationCheck_Report.htm
(01) 2019-05-09 10:44:05 Slp: Error: Action "Microsoft.SqlServer.Configuration.RulesEngineExtension.RunRulesAction" threw an exception during execution.
(01) 2019-05-09 10:44:05 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: The Windows Management Instrumentation (WMI) service cannot be started. To continue with the installation, you must troubleshoot and repair your Windows Management Instrumentation (WMI) service. ---> Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngineRuleFailureException: The Windows Management Instrumentation (WMI) service cannot be started. To continue with the installation, you must troubleshoot and repair your Windows Management Instrumentation (WMI) service.
(01) 2019-05-09 10:44:05 Slp: at Microsoft.SqlServer.Configuration.RulesEngineExtension.RunRulesAction.ExecuteAction(String actionId)
`

Missing installation attributes

Cookbook does not allow you to set directory file locations for the following parameters:

'backupdir'
'collation'
'tempdbdir'
'templogdir'
'userdbdir'
'userlogdir'

Cannot set custom install_dir or data_dir

Cookbook version

5.4.1

Chef-client version

12.21.26

Platform Details

Windows server 2016

Scenario:

Setting a different/custom install dir or data dir.
Doesnt matter which SQL Server version. Tried SQL 2014 Express, SQL 2016 Express and 2017 express.

Steps to Reproduce:

Set "sql_data_dir" or "install_dir" with a valid path like "c:\sql_data\" and run chef-client.

Expected Result:

That SQL server will install succesfully and in correct directory.

Actual Result:

Chef-client run fails with:
================================================================================
Error executing action install on resource 'sql_server_install[Install SQL Server]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
windows_package[Microsoft SQL Server 2014 (64-bit)] (c:/chef/cache/cookbooks/sql_server/resources/install.rb line 163) 
had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42, 127, 3010], but received '-2061893624'
---- Begin output of start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe"   /q /ConfigurationFile=c:/chef/cache/ConfigurationFile.ini  & exit %%%%ERRORLEVEL%%%% ----
STDOUT:
STDERR:
---- End output of start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe"   /q /ConfigurationFile=c:/chef/cache/ConfigurationFile.ini  & exit %%%%ERRORLEVEL%%%% ----
Ran start "" /wait "c:\chef\cache\package\sqlexpr_x64_enu.exe"   /q /ConfigurationFile=c:/chef/cache/ConfigurationFile.ini  & exit %%%%ERRORLEVEL%%%% returned -2061893624

TypeError: no implicit conversion of nil into String (../resource/install.rb)

Cookbook version

5.4

Chef-client version

12.18.31

Platform Details

Windows 10 - Build 10586

Scenario:

Attempting to converge a wrapper script that is using sql_server cookbook as a dependency in the metadata.rb

Steps to Reproduce:

Key information in the kitchen.yml

driver:
  name: hyperv
  parent_vhd_folder: C:\kitchen-vms
  parent_vhd_name: Windows2012SEBaseWithChef.vhdx
  memory_startup_bytes: 3GB
  processor_count: 2
  vm_generation: 2
  disable_secureboot: true

provisioner:
  name: chef_zero
  require_chef_omnibus: 12.18.31
  data_bags_path: test/fixtures/data_bags
  environments_path: test/fixtures/environments
  retry_on_exit_code:
    - 259

The command command being run is simply:
kitchen create
and shortly thereafter
kitchen converge

Expected Result:

Expecting the the resource to converge successfully out of the list of recipes in the wrapper cookbook's default.rb

Actual Result:

It appears the output is spitting out errors referencing ``` /cookbooks/sql_server/resources/install.rb

More specifically : 
```  ================================================================================
           Error executing action `install` on resource 'sql_server_install[Install SQL Server 2014]'
           ================================================================================

           TypeError
           ---------
           windows_package[Microsoft SQL Server 2014 (64-bit)] (C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/sql_server/resources/install.rb line 166) had an error: TypeError: no implicit conversion of nil into String

Error in ConfigurationFile.ini

Cookbook version

5.4.0

Chef-client version

13.6.4

Platform Details

Windows Server 2016 (v10.0.14393.0) running on HyperV.

Scenario:

Install SQL Express 2016 by configuring sql_server_install resource

Steps to Reproduce:

Configure resource in a recipe:

sql_server_install "Install SQL 2016 Express" do
source_url privateUrl
version '2016'
sa_password 'TheSecurePassword'
sql_reboot false
accept_eula true
end

Expected Result:

Installation of SQL Express to take place once the recipe is invoked.

Actual Result:

See attached error. Conflict in ConfigurationFile.ini, due to @feature being null.
error.log

ChefSpec test fails when run on Windows due to inability to match Windows end of line

As per chefspec/chefspec#373 the two checks for values of "SQLSYSADMINACCOUNTS" fail due to the $ to match the end of line in the regex with the following:

rspec ./spec/unit/recipes/server_spec.rb:40 # sql_server::server When specifying an Array of admin users for "sysadmins" creates the correct ConfigurationFile.ini template
rspec ./spec/unit/recipes/server_spec.rb:58 # sql_server::server When specifying a String for "sysadmins" creates the correct ConfigurationFile.ini template

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.