{"record":{"id":"ba297a753f749b61","repo":"puppetlabs/puppet","slug":"will-not-start-disabled-service-resource-name-w","errorCode":null,"errorMessage":"Will not start disabled service %{resource_name} without managing enable. Specify 'enable => false' to override.","messagePattern":"Will not start disabled service %(.+?) without managing enable\\. Specify 'enable => false' to override\\.","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/service/windows.rb","lineNumber":76,"sourceCode":"    else\n      raise Puppet::Error, _(\"Unknown start type: %{start_type}\") % { start_type: start_type }\n    end\n  rescue => detail\n    raise Puppet::Error.new(_(\"Cannot get start type %{resource_name}, error was: %{detail}\") % { resource_name: @resource[:name], detail: detail }, detail)\n  end\n\n  def start\n    if status == :paused\n      Puppet::Util::Windows::Service.resume(@resource[:name], timeout: @resource[:timeout])\n      return\n    end\n\n    # status == :stopped here\n\n    if enabled? == :false\n      # If disabled and not managing enable, respect disabled and fail.\n      if @resource[:enable].nil?\n        raise Puppet::Error, _(\"Will not start disabled service %{resource_name} without managing enable. Specify 'enable => false' to override.\") % { resource_name: @resource[:name] }\n      # Otherwise start. If enable => false, we will later sync enable and\n      # disable the service again.\n      elsif @resource[:enable] == :true\n        enable\n      else\n        manual_start\n      end\n    end\n    Puppet::Util::Windows::Service.start(@resource[:name], timeout: @resource[:timeout])\n  end\n\n  def stop\n    Puppet::Util::Windows::Service.stop(@resource[:name], timeout: @resource[:timeout])\n  end\n\n  def status\n    return :stopped unless Puppet::Util::Windows::Service.exists?(@resource[:name])\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/service/windows.rb#L58-L94","documentation":"Raised by Puppet's Windows service provider when asked to start a service that is currently disabled (SERVICE_DISABLED) while the manifest does not manage the `enable` attribute. The provider refuses rather than silently overriding the disable: with `enable` unset it raises; with `enable => true` it enables the service first; with `enable => false` it temporarily sets manual start, starts the service, and re-disables afterwards.","triggerScenarios":"A manifest containing `service { 'x': ensure => running }` (no `enable` property) on a Windows node where service x has start type Disabled — common when a baseline/GPO disabled the service or the package installed it disabled by default.","commonSituations":"Security baselines disable a service (e.g., RemoteRegistry) and later a module tries to run it; software installed disabled-by-default; the error message's own hint ('Specify enable => false') telling you exactly which property to add.","solutions":["If the service should stay enabled, declare `enable => true` so Puppet enables and starts it.","If you want it started now but disabled at boot, declare `enable => false` — the provider sets manual, starts, then re-disables.","If the disable is intentional and the service must not run, change the manifest to `ensure => stopped`.","If someone else disabled it unexpectedly, investigate with `sc.exe qc <name>` and your GPO/baseline before overriding."],"exampleFix":"# before\nservice { 'myagent': ensure => running }\n# after - start now, keep disabled at boot\nservice { 'myagent':\n  ensure => running,\n  enable => false,\n}","handlingStrategy":"validation","validationCode":"# manifest-side: always pair ensure with an explicit enable on Windows\n# node-side pre-check:\n#   sc.exe qc myapp   (look for START_TYPE == 4 DISABLED)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always declare `enable` alongside `ensure` for Windows service resources.","Audit disabled-by-default services with `sc.exe qc` before adding ensure => running.","Remember the provider's contract: enable=>true enables at boot; enable=>false starts now and re-disables after."],"tags":["windows","service-management","puppet","service-disabled"],"backgroundTag":"disabled-service-start-blocked","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}