Windows and the sql_server cookbook


#1

Has anyone had any success with the sql_server cookbook on Windows Server
2008r2?

Issues I’m having:

Running on ec2 WinServer 2008r2 32 bit, chef-solo with the node.save
commented out:

line numbers are missing from error messages
[Fri, 17 Feb 2012 17:34:35 +0000] INFO: Processing
remote_directory[c:/chef/handlers] action create (chef_handler::default
line /c
hef/cache/cookbooks/chef_handler/recipes/default.rb)

sql_server not indicating that it’s missing dependencies.
I missed adding the chef_handler cookbook as the sql_server recipe didn’t
error on missing deps. It just ran until I got to the next error which was
a failure to restart the MSSQL$SQLEXPRESS service because the service
didn’t exist.

I have been unable to determine why the service isn’t created - all the
blocks prior to the restart notification complete successfully.

At this point I turned to my hosted chef to see if it was just chef-solo
that hated me.
Running against hosted chef is where I discovered I was missing the
chef_handler cookbook because the uploads to the cookbook repo errored at
me.

In this setup, I bootstrapped an ec2 VM with the following command:
knife bootstrap windows winrm -r ‘role[sql]’ -x Administrator
and it failed with the known uid bug (chef-2633)

Which leads me to ask the questions:
Has anyone succeeded with a sql_server cookbook install and when is 10.10
going to be released so I can get past the uid bug? Is there anything I’m
missing?

Sascha


#2

Sasha,
Try leaving the ‘chef_handler::default’ recipe off of your node’s run list. It appears the remote_file resource declaration in that recipe [0] has a user and group of ‘root’ neither of which exist on a Windows machine and would explain the cryptic UID error.

You correctly observed the sql_server cookbook has a transitive dependency on the chef_handler cookbook. This dependency occurs through the windows cookbook which relies on the chef_handler LWRP for registering the optional WindowsRebootHandler [1]. Although the windows cookbook expects the chef_handler cookbook to be present on the node (so the LWRP can be loaded) it does not need the chef_handler::default recipe in the run list. As long as all cookbooks were uploaded to the Chef Server then chef-client will ensure all cookbooks are downloaded to the node by way of the ‘depends’ declarations in the metadata.rb of all cookbooks involved.

Also be sure to call ‘knife cookbook upload’ with a -d option to ensure a cookbook is uploaded along with all of the cookbooks it depends on.

Hope that helps!


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0] https://github.com/opscode/cookbooks/blob/master/chef_handler/recipes/default.rb#L25-27
[1] https://github.com/opscode/cookbooks/blob/master/windows/recipes/reboot_handler.rb

On Friday, February 17, 2012 at 1:09 PM, Sascha Bates wrote:

Has anyone had any success with the sql_server cookbook on Windows Server 2008r2?

Issues I’m having:

Running on ec2 WinServer 2008r2 32 bit, chef-solo with the node.save commented out:

line numbers are missing from error messages
[Fri, 17 Feb 2012 17:34:35 +0000] INFO: Processing remote_directory[c:/chef/handlers] action create (chef_handler::default line /chef/cache/cookbooks/chef_handler/recipes/default.rb)

sql_server not indicating that it’s missing dependencies.
I missed adding the chef_handler cookbook as the sql_server recipe didn’t error on missing deps. It just ran until I got to the next error which was a failure to restart the MSSQL$SQLEXPRESS service because the service didn’t exist.

I have been unable to determine why the service isn’t created - all the blocks prior to the restart notification complete successfully.

At this point I turned to my hosted chef to see if it was just chef-solo that hated me.
Running against hosted chef is where I discovered I was missing the chef_handler cookbook because the uploads to the cookbook repo errored at me.

In this setup, I bootstrapped an ec2 VM with the following command:
knife bootstrap windows winrm -r ‘role[sql]’ -x Administrator
and it failed with the known uid bug (chef-2633)

Which leads me to ask the questions:
Has anyone succeeded with a sql_server cookbook install and when is 10.10 going to be released so I can get past the uid bug? Is there anything I’m missing?

Sascha


#3

Thanks for the 411 on the handler. That makes my life easier. I’m in the
early days of a proof of concept so I was just snagging cookbooks one by
one as I needed them and forgot to audit the metadata before playing
around, which is why I didn’t notice deps right away.

So then I’m back to my other issue which is why the SQL service isn’t being
created despite a dearth of failure messages. I’ve already shut down my
stuff for the evening, but if you could offer me any advice on what to look
at for why it’s failing, I’ll take it up again in the morning.

On Fri, Feb 17, 2012 at 9:52 PM, Seth Chisamore schisamo@opscode.comwrote:

Sasha,
Try leaving the ‘chef_handler::default’ recipe off of your node’s run
list. It appears the remote_file resource declaration in that recipe [0]
has a user and group of ‘root’ neither of which exist on a Windows machine
and would explain the cryptic UID error.

You correctly observed the sql_server cookbook has a transitive dependency
on the chef_handler cookbook. This dependency occurs through the windows
cookbook which relies on the chef_handler LWRP for registering the
optional WindowsRebootHandler [1]. Although the windows cookbook expects
the chef_handler cookbook to be present on the node (so the LWRP can be
loaded) it does not need the chef_handler::default recipe in the run list.
As long as all cookbooks were uploaded to the Chef Server then chef-client
will ensure all cookbooks are downloaded to the node by way of the
’depends’ declarations in the metadata.rb of all cookbooks involved.

Also be sure to call ‘knife cookbook upload’ with a -d option to ensure a
cookbook is uploaded along with all of the cookbooks it depends on.

Hope that helps!


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0]
https://github.com/opscode/cookbooks/blob/master/chef_handler/recipes/default.rb#L25-27
[1]
https://github.com/opscode/cookbooks/blob/master/windows/recipes/reboot_handler.rb

On Friday, February 17, 2012 at 1:09 PM, Sascha Bates wrote:

Has anyone had any success with the sql_server cookbook on Windows Server
2008r2?

Issues I’m having:

Running on ec2 WinServer 2008r2 32 bit, chef-solo with the node.save
commented out:

line numbers are missing from error messages
[Fri, 17 Feb 2012 17:34:35 +0000] INFO: Processing
remote_directory[c:/chef/handlers] action create (chef_handler::default
line /c
hef/cache/cookbooks/chef_handler/recipes/default.rb)

sql_server not indicating that it’s missing dependencies.
I missed adding the chef_handler cookbook as the sql_server recipe didn’t
error on missing deps. It just ran until I got to the next error which was
a failure to restart the MSSQL$SQLEXPRESS service because the service
didn’t exist.

I have been unable to determine why the service isn’t created - all the
blocks prior to the restart notification complete successfully.

At this point I turned to my hosted chef to see if it was just chef-solo
that hated me.
Running against hosted chef is where I discovered I was missing the
chef_handler cookbook because the uploads to the cookbook repo errored at
me.

In this setup, I bootstrapped an ec2 VM with the following command:
knife bootstrap windows winrm -r ‘role[sql]’ -x Administrator
and it failed with the known uid bug (chef-2633)

Which leads me to ask the questions:
Has anyone succeeded with a sql_server cookbook install and when is 10.10
going to be released so I can get past the uid bug? Is there anything I’m
missing?

Sascha


#4

Sasha,
The sql_server cookbook doesn’t actual create any services…it just uses the Chef service resource to wrap/interact with the underlying service created by the SQLServer installer. The actual service name differs per installation of SQL Server and uses the form:

MSSQL$ + SQL Server instance name

So if you installed SQL Server Express with all default options the service name would be ‘MSSQL$SQLEXPRESS’.

One of the nice things about using Chef to install SQL Server is this actual instance name is configurable by a cookbook attribute [0] (i.e. you can set it in role). This value is leveraged by by the installer response template file [1] [ (i.e. ConfigurationFile.ini) and the service resource in the recipe [2].

I would also recommend generating a full set of debug output (i.e. chef-client -l debug) and throwing it in a gist, as this will help the group debug your issue.


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0] https://github.com/opscode/cookbooks/blob/master/sql_server/attributes/server.rb#L24
[1] https://github.com/opscode/cookbooks/blob/master/sql_server/templates/default/ConfigurationFile.ini.erb#L21
[2] https://github.com/opscode/cookbooks/blob/master/sql_server/recipes/server.rb#L23

On Friday, February 17, 2012 at 8:18 PM, Sascha Bates wrote:

Thanks for the 411 on the handler. That makes my life easier. I’m in the early days of a proof of concept so I was just snagging cookbooks one by one as I needed them and forgot to audit the metadata before playing around, which is why I didn’t notice deps right away.

So then I’m back to my other issue which is why the SQL service isn’t being created despite a dearth of failure messages. I’ve already shut down my stuff for the evening, but if you could offer me any advice on what to look at for why it’s failing, I’ll take it up again in the morning.
On Fri, Feb 17, 2012 at 9:52 PM, Seth Chisamore <schisamo@opscode.com (mailto:schisamo@opscode.com)> wrote:

Sasha,
Try leaving the ‘chef_handler::default’ recipe off of your node’s run list. It appears the remote_file resource declaration in that recipe [0] has a user and group of ‘root’ neither of which exist on a Windows machine and would explain the cryptic UID error.

You correctly observed the sql_server cookbook has a transitive dependency on the chef_handler cookbook. This dependency occurs through the windows cookbook which relies on the chef_handler LWRP for registering the optional WindowsRebootHandler [1]. Although the windows cookbook expects the chef_handler cookbook to be present on the node (so the LWRP can be loaded) it does not need the chef_handler::default recipe in the run list. As long as all cookbooks were uploaded to the Chef Server then chef-client will ensure all cookbooks are downloaded to the node by way of the ‘depends’ declarations in the metadata.rb of all cookbooks involved.

Also be sure to call ‘knife cookbook upload’ with a -d option to ensure a cookbook is uploaded along with all of the cookbooks it depends on.

Hope that helps!


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0] https://github.com/opscode/cookbooks/blob/master/chef_handler/recipes/default.rb#L25-27
[1] https://github.com/opscode/cookbooks/blob/master/windows/recipes/reboot_handler.rb

On Friday, February 17, 2012 at 1:09 PM, Sascha Bates wrote:

Has anyone had any success with the sql_server cookbook on Windows Server 2008r2?

Issues I’m having:

Running on ec2 WinServer 2008r2 32 bit, chef-solo with the node.save commented out:

line numbers are missing from error messages
[Fri, 17 Feb 2012 17:34:35 +0000] INFO: Processing remote_directory[c:/chef/handlers] action create (chef_handler::default line /chef/cache/cookbooks/chef_handler/recipes/default.rb)

sql_server not indicating that it’s missing dependencies.
I missed adding the chef_handler cookbook as the sql_server recipe didn’t error on missing deps. It just ran until I got to the next error which was a failure to restart the MSSQL$SQLEXPRESS service because the service didn’t exist.

I have been unable to determine why the service isn’t created - all the blocks prior to the restart notification complete successfully.

At this point I turned to my hosted chef to see if it was just chef-solo that hated me.
Running against hosted chef is where I discovered I was missing the chef_handler cookbook because the uploads to the cookbook repo errored at me.

In this setup, I bootstrapped an ec2 VM with the following command:
knife bootstrap windows winrm -r ‘role[sql]’ -x Administrator
and it failed with the known uid bug (chef-2633)

Which leads me to ask the questions:
Has anyone succeeded with a sql_server cookbook install and when is 10.10 going to be released so I can get past the uid bug? Is there anything I’m missing?

Sascha


#5

Y

On Sat, Feb 18, 2012 at 9:30 AM, Seth Chisamore schisamo@opscode.comwrote:

Sasha,
The sql_server cookbook doesn’t actual create any services…it just uses
the Chef service resource to wrap/interact with the underlying service
created by the SQLServer installer. The actual service name differs per
installation of SQL Server and uses the form:

MSSQL$ + SQL Server instance name

So if you installed SQL Server Express with all default options the
service name would be ‘MSSQL$SQLEXPRESS’.

One of the nice things about using Chef to install SQL Server is this
actual instance name is configurable by a cookbook attribute [0] (i.e. you
can set it in role). This value is leveraged by by the installer response
template file [1] [ (i.e. ConfigurationFile.ini) and the service resource
in the recipe [2].

I would also recommend generating a full set of debug output (i.e.
chef-client -l debug) and throwing it in a gist, as this will help the
group debug your issue.


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0]
https://github.com/opscode/cookbooks/blob/master/sql_server/attributes/server.rb#L24
[1]
https://github.com/opscode/cookbooks/blob/master/sql_server/templates/default/ConfigurationFile.ini.erb#L21
[2]
https://github.com/opscode/cookbooks/blob/master/sql_server/recipes/server.rb#L23

On Friday, February 17, 2012 at 8:18 PM, Sascha Bates wrote:

Thanks for the 411 on the handler. That makes my life easier. I’m in the
early days of a proof of concept so I was just snagging cookbooks one by
one as I needed them and forgot to audit the metadata before playing
around, which is why I didn’t notice deps right away.

So then I’m back to my other issue which is why the SQL service isn’t
being created despite a dearth of failure messages. I’ve already shut down
my stuff for the evening, but if you could offer me any advice on what to
look at for why it’s failing, I’ll take it up again in the morning.

On Fri, Feb 17, 2012 at 9:52 PM, Seth Chisamore schisamo@opscode.comwrote:

Sasha,
Try leaving the ‘chef_handler::default’ recipe off of your node’s run
list. It appears the remote_file resource declaration in that recipe [0]
has a user and group of ‘root’ neither of which exist on a Windows machine
and would explain the cryptic UID error.

You correctly observed the sql_server cookbook has a transitive dependency
on the chef_handler cookbook. This dependency occurs through the windows
cookbook which relies on the chef_handler LWRP for registering the
optional WindowsRebootHandler [1]. Although the windows cookbook expects
the chef_handler cookbook to be present on the node (so the LWRP can be
loaded) it does not need the chef_handler::default recipe in the run list.
As long as all cookbooks were uploaded to the Chef Server then chef-client
will ensure all cookbooks are downloaded to the node by way of the
’depends’ declarations in the metadata.rb of all cookbooks involved.

Also be sure to call ‘knife cookbook upload’ with a -d option to ensure a
cookbook is uploaded along with all of the cookbooks it depends on.

Hope that helps!


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0]
https://github.com/opscode/cookbooks/blob/master/chef_handler/recipes/default.rb#L25-27
[1]
https://github.com/opscode/cookbooks/blob/master/windows/recipes/reboot_handler.rb

On Friday, February 17, 2012 at 1:09 PM, Sascha Bates wrote:

Has anyone had any success with the sql_server cookbook on Windows Server
2008r2?

Issues I’m having:

Running on ec2 WinServer 2008r2 32 bit, chef-solo with the node.save
commented out:

line numbers are missing from error messages
[Fri, 17 Feb 2012 17:34:35 +0000] INFO: Processing
remote_directory[c:/chef/handlers] action create (chef_handler::default
line /c
hef/cache/cookbooks/chef_handler/recipes/default.rb)

sql_server not indicating that it’s missing dependencies.
I missed adding the chef_handler cookbook as the sql_server recipe didn’t
error on missing deps. It just ran until I got to the next error which was
a failure to restart the MSSQL$SQLEXPRESS service because the service
didn’t exist.

I have been unable to determine why the service isn’t created - all the
blocks prior to the restart notification complete successfully.

At this point I turned to my hosted chef to see if it was just chef-solo
that hated me.
Running against hosted chef is where I discovered I was missing the
chef_handler cookbook because the uploads to the cookbook repo errored at
me.

In this setup, I bootstrapped an ec2 VM with the following command:
knife bootstrap windows winrm -r ‘role[sql]’ -x Administrator
and it failed with the known uid bug (chef-2633)

Which leads me to ask the questions:
Has anyone succeeded with a sql_server cookbook install and when is 10.10
going to be released so I can get past the uid bug? Is there anything I’m
missing?

Sascha


#6

Sorry, keyboard fumbles this morning. I ran a fresh install this morning
and had no issues with the supporting set of cookbooks. I had the exact
same issue again with sql_server. I examined the configuration file and
the install directory which does not seem to be getting fully created.
None of the SQL services are created. I found a restart.rb in the sql
install folder and it notes the service name as MSSQL$SQLEXPRESS.

I ran through a manual install and noted that the recipe appears to be
using all default values except for the auth type which defaults to
SQL-only but calls for mixed mode with the Chef recipe. I have been remote
bootstrapping the instances which is convenient for administration, but
crappy for debugging as the log lines just get cut off.

I will run through another bootstrap install and run the client directly on
the server in order to get maximum debug output. The only custom attribute
I have is to accept the license. Maybe I will hardcode that in the recipe
and see what that does for my mileage as well.

On Sat, Feb 18, 2012 at 9:36 AM, Sascha Bates sascha.bates@gmail.comwrote:

Y

On Sat, Feb 18, 2012 at 9:30 AM, Seth Chisamore schisamo@opscode.comwrote:

Sasha,
The sql_server cookbook doesn’t actual create any services…it just uses
the Chef service resource to wrap/interact with the underlying service
created by the SQLServer installer. The actual service name differs per
installation of SQL Server and uses the form:

MSSQL$ + SQL Server instance name

So if you installed SQL Server Express with all default options the
service name would be ‘MSSQL$SQLEXPRESS’.

One of the nice things about using Chef to install SQL Server is this
actual instance name is configurable by a cookbook attribute [0] (i.e. you
can set it in role). This value is leveraged by by the installer response
template file [1] [ (i.e. ConfigurationFile.ini) and the service resource
in the recipe [2].

I would also recommend generating a full set of debug output (i.e.
chef-client -l debug) and throwing it in a gist, as this will help the
group debug your issue.


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0]
https://github.com/opscode/cookbooks/blob/master/sql_server/attributes/server.rb#L24
[1]
https://github.com/opscode/cookbooks/blob/master/sql_server/templates/default/ConfigurationFile.ini.erb#L21
[2]
https://github.com/opscode/cookbooks/blob/master/sql_server/recipes/server.rb#L23

On Friday, February 17, 2012 at 8:18 PM, Sascha Bates wrote:

Thanks for the 411 on the handler. That makes my life easier. I’m in
the early days of a proof of concept so I was just snagging cookbooks one
by one as I needed them and forgot to audit the metadata before playing
around, which is why I didn’t notice deps right away.

So then I’m back to my other issue which is why the SQL service isn’t
being created despite a dearth of failure messages. I’ve already shut down
my stuff for the evening, but if you could offer me any advice on what to
look at for why it’s failing, I’ll take it up again in the morning.

On Fri, Feb 17, 2012 at 9:52 PM, Seth Chisamore schisamo@opscode.comwrote:

Sasha,
Try leaving the ‘chef_handler::default’ recipe off of your node’s run
list. It appears the remote_file resource declaration in that recipe [0]
has a user and group of ‘root’ neither of which exist on a Windows machine
and would explain the cryptic UID error.

You correctly observed the sql_server cookbook has a transitive
dependency on the chef_handler cookbook. This dependency occurs through
the windows cookbook which relies on the chef_handler LWRP for registering
the optional WindowsRebootHandler [1]. Although the windows cookbook
expects the chef_handler cookbook to be present on the node (so the LWRP
can be loaded) it does not need the chef_handler::default recipe in the run
list. As long as all cookbooks were uploaded to the Chef Server then
chef-client will ensure all cookbooks are downloaded to the node by way of
the ‘depends’ declarations in the metadata.rb of all cookbooks involved.

Also be sure to call ‘knife cookbook upload’ with a -d option to ensure a
cookbook is uploaded along with all of the cookbooks it depends on.

Hope that helps!


Seth Chisamore
Software Development Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

[0]
https://github.com/opscode/cookbooks/blob/master/chef_handler/recipes/default.rb#L25-27
[1]
https://github.com/opscode/cookbooks/blob/master/windows/recipes/reboot_handler.rb

On Friday, February 17, 2012 at 1:09 PM, Sascha Bates wrote:

Has anyone had any success with the sql_server cookbook on Windows Server
2008r2?

Issues I’m having:

Running on ec2 WinServer 2008r2 32 bit, chef-solo with the node.save
commented out:

line numbers are missing from error messages
[Fri, 17 Feb 2012 17:34:35 +0000] INFO: Processing
remote_directory[c:/chef/handlers] action create (chef_handler::default
line /c
hef/cache/cookbooks/chef_handler/recipes/default.rb)

sql_server not indicating that it’s missing dependencies.
I missed adding the chef_handler cookbook as the sql_server recipe didn’t
error on missing deps. It just ran until I got to the next error which was
a failure to restart the MSSQL$SQLEXPRESS service because the service
didn’t exist.

I have been unable to determine why the service isn’t created - all the
blocks prior to the restart notification complete successfully.

At this point I turned to my hosted chef to see if it was just chef-solo
that hated me.
Running against hosted chef is where I discovered I was missing the
chef_handler cookbook because the uploads to the cookbook repo errored at
me.

In this setup, I bootstrapped an ec2 VM with the following command:
knife bootstrap windows winrm -r ‘role[sql]’ -x Administrator
and it failed with the known uid bug (chef-2633)

Which leads me to ask the questions:
Has anyone succeeded with a sql_server cookbook install and when is 10.10
going to be released so I can get past the uid bug? Is there anything I’m
missing?

Sascha