Open mrswadge opened 5 years ago
Hey There It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you. Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.
If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.
@mrswadge Thank you for opening this issue. We will see if we can get that issue reproduced and a sensible fix out. Thanks again for taking the time to track that down.
Thanks for the swift response @TheLunaticScripter
I've done some further digging and it appears the error messages in the Command Line Utilities installer regarding dependencies are a mess.
If you install ODBC Driver 11, the Command Line Utilities still complains about missing ODBC Driver 11. The error message is incorrect and it actually depends upon ODBC Driver 13.1.
I figured that I would try to install newer versions of the tools, but ODBC 17 (link) has an additional dependency on Visual C++ 2017 (link). This combination is compatible with Command Line Utilities 15 (link).
Perhaps going a little off-topic for this bug report, but I'm not sure that I need all of the client software installed, I only need ODBC and the Command Line Utilities. What I'm attempting to do via my cookbook is allow an offline (aka air-gapped) install of the clients, but there doesn't appear to be a way of limiting the install to a couple of packages as the list is hardcoded in recipe/client.rb %w( native_client command_line_utils clr_types smo ps_extensions ).each do |pkg|
. Adding some flexibility here would be a nice addition to the cookbook.
Thanks, Stuart
To keep my project moving forward I have done the following within my cookbook which is essentially aimed towards wrapping the sql_server cookbook to provide offline installer packages.
I have created recipe\client.rb
which calls to a similarly styled wrapper of the vcruntime cookbook. It reduces the scope of the client install to ODBC drivers and Command Line Utilities only and uses an attribute to define the term used for the user agreement. I guess the dependency management could be better handled for the VC Runtime.
include_recipe 'otbo_vcruntime::vc15'
%w( odbc command_line_utils ).each do |pkg|
package node['sql_server'][pkg]['package_name'] do # ~FC009
source node['sql_server'][pkg]['url']
checksum node['sql_server'][pkg]['checksum']
installer_type :msi
options "#{node['sql_server'][pkg]['terms']}=#{node['sql_server'][pkg]['accept_eula'] ? 'YES' : 'NO'}"
action :install
end
end
# update path
windows_path "#{node['sql_server']['install_dir']}\\#{SqlServer::Helper.install_dir_version(node['sql_server']['version'])}\\Tools\\Binn" do
action :add
end
The attributes that I use in my cookbooks attributes\client.rb
are as follows.
default['sql_server']['odbc']['url'] = Addressable::URI.convert_path( File.join( Chef::Config[:file_cache_path], 'cookbooks', 'otbo_sql_server', 'files', 'default', 'msodbcsql_17.3.1.1_x64.msi' ) ).to_s.gsub(/#/, '%23')
default['sql_server']['odbc']['checksum'] = 'cdff489db121cead78f87bc33f9fdb072432d637fb9c2905d0cbda2310f87086'
default['sql_server']['odbc']['package_name'] = 'Microsoft SQL Server - ODBC Driver 17.3.1.1'
default['sql_server']['odbc']['terms'] = 'IACCEPTMSODBCSQLLICENSETERMS'
default['sql_server']['odbc']['accept_eula'] = true
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'] = '36d06ecf77ddb75a68f6bf3e0a7cec1ff5f3db1432672eb2950301bec2500bc1'
default['sql_server']['command_line_utils']['package_name'] = 'Microsoft SQL Server - Command Line Utilities 15'
default['sql_server']['command_line_utils']['terms'] = 'IACCEPTMSSQLCMDLNUTILSLICENSETERMS'
default['sql_server']['command_line_utils']['accept_eula'] = true
Apart from getting the install directory, I suppose that I'm not really using the sql_server cookbook, but perhaps in the future I'll be able to make heavier use of it.
Hope this is useful in some way.
Cheers, Stuart
@mrswadge Sweet I'm glad you were able to get a workaround. So the direction of this cookbook is to move as much of the current recipe based content into custom resources. Currently, the server installation has been moved over but there hasn't been a demand to move the client install pieces over yet. I think using the library and then your own use of the package install is the best implementation and is going to give you the most flexibility. I'm going to keep this issue open just to track the bug but it will probably be a while before I can get around to that custom resource.
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 viametadata.rb
.Added Attributes:
Recipe simply calls through to sql_server::client cookbook via include_recipe.
Expected Result:
Successful installation of SQL Server Native Client and SQL Server Command Line Utilities.
Actual Result:
Further investigation shows that the provided IACCEPTSQLNCLILICENSETERMS=YES is incorrect as it should be IACCEPTMSODBCSQLLICENSETERMS=YES
You cannot install the Command Line Utilities without the ODBC drivers.
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)