Skip to content

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

@mrswadge

Description

@mrswadge

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions