[chef] Re: Re: Service resource on windows returning error: An instance of the service is already running.


Chronological Thread 
  • From: Ranjib Dey < >
  • To: " " < >
  • Subject: [chef] Re: Re: Service resource on windows returning error: An instance of the service is already running.
  • Date: Tue, 7 Jul 2015 15:30:13 -0700

i think the status check is failing. chef service providers generally uses status checks to understand if a service is already running or not. im looking at this code : https://github.com/chef/chef/blob/master/lib/chef/provider/service/windows.rb#L309
may be start with irb and then require that gem and execute the same code there, to see whats wrong.

On Tue, Jul 7, 2015 at 3:18 PM, Dan-Joe Lopez < " target="_blank"> > wrote:
Here is the stacktrace:

Generated at 2015-07-07 21:42:39 +0000
SystemCallError: service[Apache2.2] (GA-apache-config::default line 26) had an error: SystemCallError: An instance of the service is already running. - StartService: An instance of the service is already running.
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/win32-service-0.8.2/lib/win32/windows/helper.rb:36:in `raise_windows_error'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/win32-service-0.8.2/lib/win32/service.rb:723:in `start'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6-x86-mingw32/lib/chef/provider/service/windows.rb:74:in `block in start_service'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6-x86-mingw32/lib/chef/provider/service/windows.rb:187:in `block in spawn_command_thread'
c:/opscode/chef/embedded/lib/ruby/1.9.1/win32ole.rb:13:in `call'
c:/opscode/chef/embedded/lib/ruby/1.9.1/win32ole.rb:13:in `block in initialize'

This occurred on Windows Server 2012 R2 Standard

Sent from Windows Mail

From:  " target="_blank">Dan-Joe Lopez
Sent: ‎Tuesday‎, ‎July‎ ‎7‎, ‎2015 ‎3‎:‎06‎ ‎PM
To:  " target="_blank">

Hello Chefs,

I feel as though I am mistaking something here.  The basic idea of chef resources, as explained to me, is that they describe the desired state of a system.  To that end, when I call:
service “My_Service” do
action 😖tart
end

My expectation is that it will:
Start the service if My_Service is stopped
Bail out with an error if My_Service doesn’t exist, or is in an “un-startable” state
Do *nothing* if My_Service is already started, as the service is already in the desired state

Unfortunately on the latter, it is throwing an error, that an instance of the service is already running.

Is this a limitation/bug in the way that chef for windows processes services, or a bug in my expectations of the functionality?

Many thanks in advance!
Dan-Joe Lopez

Sent from Windows Mail





Archive powered by MHonArc 2.6.16.

§